【发布时间】:2020-05-10 12:08:16
【问题描述】:
我正在使用 Hibernate 来执行我的查询,在管理面板中我得到了正确的结果,但是在 Hibernate 中使用时它没有给出任何结果。
道层——
@Query("select new com.eventila.pms.entity.ReferenceLead(projectId,count(lm)) from LeadMaster lm where lm.vendorId= ?1 and lm.source = 'share' group by lm.projectId")
List<ReferenceLead> getReferenceByUser(String userId);
波乔-
@lombok.Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ReferenceLead {
String projectId;
Long referenceLead;
Long count;
protected ReferenceLead(){}
public ReferenceLead(String projectId,Long count) {
this.projectId=projectId;
this.count=count;
}
}
执行此操作后,我得到一个空列表。 请帮帮我。
【问题讨论】:
-
请将您的
LeadMaster实体添加到问题中。
标签: java sql hibernate spring-boot psql