hibernate remove duplication from hql
this is a question following hibernate what is the right way to load object graph the answer correctly do the work. but because I can not use set(I need order)开发者_StackOverflow中文版 and trying to avoid treeSet, I use the list in the GrandCat and Cat class. when I use the query, the cat number is not right, instead of 3, it gives me 4. any good way to eliminate this? it has 2 fay Cat in the list.
select distinct c from Cat as c ....
See this.
精彩评论