I have this query written in Spring Data JPA :
@Query(value = "SELECT x,y, sum(x,y) FROM table WHERE x = ?1 groupby x,y ", nativeQuery = true) and I have entity class as
@Entity class abc { int x; int y; //setter and getter } How to map the result of this query to a POJO or Entity class??
PS: This works:
@Query(value = "SELECT * FROM table WHERE x = ?1 ", nativeQuery = true)