| Hi all,
 I haved evaluated Hibernate as part of my master thesis and just have a question regarding natural sorting of collections. Consider the following (made up) scenario:
 
 <set name="pets"
 table="person_pet"
 sort="natural">
 <key column="person_id"/>
 <composite-element class="Pet"/>
 </set>
 
 In the book Hibernate in action its described that natural sort will use the compareTo() method of java.lang.String to sort the collection in memory. But i cant seem to find information on which elements are compared to eachother. Are all the elements of Pet, in this case, used? Or is it sorted by the key somehow. I cant find any information on this and would appreciate if anyone could clarify it for me.
 
 Cheers / A.Kikr
 
 PS. This forum is awsome! Cool that the Hibernate team takes the time to answer so many questions. DS.
 
 
 |