-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Sorting / Ordering a many to one set
PostPosted: Wed Dec 07, 2005 11:32 pm 
Newbie

Joined: Fri Nov 25, 2005 12:26 pm
Posts: 4
Hibernate version: 3

Mapping documents:

<class name="Person" table="person">

...
<set name="visits" lazy="false" inverse="true" >
<key column="person_id"/>
<one-to-many class="Visit"/>
</set>

</class>

<class name="Visit" table="visit">
...
<property name="dateOf" type="date" not-null="false"/>
<many-to-one name="person"
class="Person"/>

</class>



So as you can see from the code , I have two objects , one Person which contains a set of many Visits . The visit object has a dateOf field which is a date . I would like to sort / order the Set of visits in the person object based on the dateOf field .

How can this be done ?

Anticipated Thanks ,
Cosmin


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 08, 2005 11:25 am 
Newbie

Joined: Fri Nov 25, 2005 12:26 pm
Posts: 4
none / nothing ?

can this even be done in hihbernate ? or am i stuck using a dao method ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 08, 2005 1:12 pm 
Regular
Regular

Joined: Wed Feb 02, 2005 6:33 am
Posts: 70
Hibernate Documentation - Sorted Collections

Enjoy :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 08, 2005 1:23 pm 
Newbie

Joined: Fri Nov 25, 2005 12:26 pm
Posts: 4
many thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.