如何将以下查询转换为休眠条件?
select pr_name, count(*) from (select (case when serv.type=xyz then serv.nameA else serv.nameB end) as pr_name from db.serv serv where serv.date is null group by pr_name;
我有以下处理其余部分(案例部分除外)
currentSession.createCriteria(StoredData.class)
.setProjection(projectionList()
.add(groupProperty("pr_name"), "pr_name")
.add(rowCount(), "count"))
.add(isNull("date"))
.setResultTransformer(new PrCountTransformer())
.list();