Hibernate new keyword with distinct

前端 未结 1 418
孤城傲影
孤城傲影 2020-12-17 15:27

I need to take hql that is currently :

select distinct a from Asset as a where ...

and change it to

select new com.org.Asse         


        
相关标签:
1条回答
  • 2020-12-17 16:10

    Ok for anyone interested the proper syntax is

    select distinct new com.org.AssetDTO(a.id, a.address, a.status) from Asset as a where ...
    
    0 讨论(0)
提交回复
热议问题