您必须使用“新地图”语法(Hibernate参考段落14.6)
select new map(count(i.inspectionId) as tot_inspections, t.year as year, t.quarter as quarter) from ...
其余查询是相同的。这将返回一个地图列表,其中的键是“列”的别名。

您必须使用“新地图”语法(Hibernate参考段落14.6)
select new map(count(i.inspectionId) as tot_inspections, t.year as year, t.quarter as quarter) from ...
其余查询是相同的。这将返回一个地图列表,其中的键是“列”的别名。