posted 15 years ago
Hello,
I have 2 entity classes, Menugrop and Catgroup. Mengroup has one to many relationship with Catgroup. In Mengroup,
private Collection<Catgroup> catgroups = new LinkedHashSet<Catgroup>();
I write the below code to fetch Menugroup and it's catgroup.
Hibernate generates the below SQL.
The result is below:
Menu name - Computer: Personal Electronics ,Home Audio ,A/V Essentials ,Hard Drive ,Monitor & Projector ,Computers ,Flash Memory
Menu name - Electronics: Networking ,CDs/DVDs ,Components
Menu name - Phone: Books ,MP3 Players ,Home Appliances ,Power Protection ,Cameras & Photo,Printers & Scanners
When we look at the Catgroups in the Menu in the result, they are not sorted by Catgroup.name
As I use linkedHashSet, I am expecting the sorting to work, but, it did not happen?
Can anyone please suggest me what do it need to correct to make the results in ordered format?
Thanks
[ November 01, 2008: Message edited by: Saravanan Vijayappan ]