1

I have to use multiple tables,so i have used NativeQuery along with @Query annotation

    @Query( value= "select c.logo logo ,c.name customerName,(sum(wp.completion_percent)) completionPercent,sum(ks.days) days ,count(u.id) fteCount,count(w.wp_order_id) wpCount FROM wp_order w, Project p , Assignee a , User u ,Customer c ,Domains d,kpi_status ks ,wp_kpi wp where w.project_id=p.id and p.id=a.project_id and p.cust_id=c.id and w.id=wp.wpo_id and wp.id=ks.wp_kpi_id and a.status=?1"
    ,nativeQuery=true)

public List<WPOrder> getProjectJoin(String status);
  • Does this answer your question? [JPA : How to convert a native query result set to POJO class collection](https://stackoverflow.com/questions/13012584/jpa-how-to-convert-a-native-query-result-set-to-pojo-class-collection) – Edwin Dalorzo Jul 21 '20 at 05:45
  • I am using @Query Annotation with nativeQuery== true; over method inside repo class . So How can I use DTO in my case – Shivangi Vaish Jul 21 '20 at 06:05
  • @ShivangiVaish It would be helpful for others to answer the question if you correctly formatted the code portion of your question. – sachin Jul 21 '20 at 06:56
  • @sachin Mentioned Query says an error that there is ====>No converter found capable of converting from type [org.springframework.data.jpa.repository.query.AbstractJpaQuery$TupleConverter$TupleBackedMap] to type [com.infinite.springframework.dto.WPOrderResponse – Shivangi Vaish Jul 21 '20 at 08:11

0 Answers0