【发布时间】:2011-10-22 11:38:16
【问题描述】:
我需要使用当前的 hql:
select distinct a from Asset as a where ...
并将其更改为
select new com.org.AssetDTO(a.id, a.address, a.status) from Asset as a where ...
我的问题在于 distinct 关键字。它属于使用新对象查询类型的 hql 查询中的什么位置。一个想法是使用子选择并在那里有我的独特之处。我已经尝试添加distinct a.id,但这不起作用。
【问题讨论】:
标签: hibernate hql new-operator distinct