Jpa Hql

Posted 正怒月神

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Jpa Hql相关的知识,希望对你有一定的参考价值。

直接上代码

@Data
public class SS_Res 

    public SS_Res(String pol, String pod) 
        this.pol = pol;
        this.pod = pod;
    

   
    private String pol;
    private String pod;

Dao

@Query(value="select new com.example.SS_Res(" +
            " ss.pol " +
            " ,ss.pod " +
            " )"+
            " from ss_res ss , ssa_res ssa " +
            " where ss.ssUUID = ssa.ssaUUID  " +
            " and (ifnull(:companyUUID,'')='' or ssa.companyUUID=:companyUUID) " 
    List<SS_Res> findHqlExample(@Param("companyUUID")String companyUUID);

以上是关于Jpa Hql的主要内容,如果未能解决你的问题,请参考以下文章