开发者

Distinct + Order By in Hibernate

开发者 https://www.devze.com 2023-02-27 02:21 出处:网络
开发者_JAVA百科Related to my last question I have worked with that answer, but now I require to do with a bit modification using hibernate.
开发者_JAVA百科

Related to my last question

I have worked with that answer, but now I require to do with a bit modification using hibernate.

I need to now add a string to TestData class say String name Then I want to fetch Collection of TestData from db using hibernate with the distinct name and sorting as I did in the CollectionSort class.

Can anyone help me how to do this using hibernate?

Thanks.


You can reuse that comparator in Hibernate, using @Sort annotation

  • Reference
0

精彩评论

暂无评论...
验证码 换一张
取 消