在使用jpa時經(jīng)常需要自定義查詢.@query這個用的挺多的.
最近多表查詢中返回一個自定義對象.
記錄如下
@Query("select new xx.xxx.xxx.xxx.xxxx(a.xx,sa.xx,ss.xx) from table a,table sa,table ss where a.xx= sa.xx and a.xx= ss.xx and ss.xx= ?1 order by ?#{#pageable} ")
在使用jpa時經(jīng)常需要自定義查詢.@query這個用的挺多的.
最近多表查詢中返回一個自定義對象.
記錄如下
@Query("select new xx.xxx.xxx.xxx.xxxx(a.xx,sa.xx,ss.xx) from table a,table sa,table ss where a.xx= sa.xx and a.xx= ss.xx and ss.xx= ?1 order by ?#{#pageable} ")