dst*_*arh 13 hibernate hql distinct new-operator
我需要使用当前的hql:
select distinct a from Asset as a where ...
Run Code Online (Sandbox Code Playgroud)
并将其更改为
select new com.org.AssetDTO(a.id, a.address, a.status) from Asset as a where ...
Run Code Online (Sandbox Code Playgroud)
我的问题是使用distinct关键字.它在哪里属于您正在使用新的Object查询类型的hql查询.一种想法是使用一个子选择,并在那里有我的独特.我试过添加,distinct a.id但这不起作用.
dst*_*arh 21
对于任何对正确语法感兴趣的人都可以
select distinct new com.org.AssetDTO(a.id, a.address, a.status) from Asset as a where ...
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7352 次 |
| 最近记录: |