Joined: Mon Apr 25, 2005 3:55 pm Posts: 2
|
I have a situation where I'm successfuly returning a many-to-many relationship using the xml below.
<set name="starAttributeValues"
lazy="false"
cascade="all-delete-orphan"
inverse="true">
<key><column name="FK_STAR_ATTRIBUTE_VALUE_SET" /></key>
<one-to-many class="com.sainc.dao.model.StarAttributeValue" />
</set>
The resulting "set" is apperently an unsorted HashSet. I'd like to perform a sort using a TreeSet/compareTo method for display/editing purposes, but cannot because hibernate complains because I will loose the reference to the HashSet. i.e.
TreeSet myTreeSet = new TreeSet();
myTreeSet.addAll(myHibernateHashSet);
Does anybody know of a way to sort on a many-to-many relationship without loosing the reference to the hibernate object?
Thanks
|
|