-->
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.  [ 2 posts ] 
Author Message
 Post subject: Sort collection by col in 3rd table
PostPosted: Thu May 31, 2007 10:54 am 
Regular
Regular

Joined: Tue Aug 26, 2003 7:53 pm
Posts: 66
Location: Lakeland, Florida USA
Hibernate version: version 3.1.3
Name and version of the database you are using: 4.1.13-standard

3 tables, parent, child & priority

parent
-parentId
-colA

child
-childId
-colB
-priorityId

priority
-priorityId
-seq

The mapping for parent, of course, contains a set element for the child.

Quesion: Is there a way to tell Hibernate to use priority.seq for sorting the children? I am using a comparator now (sort="PolicyComplianceComparator") and this works but it might be simplier and faster to just use the db, joining child & priority.

I know about the where attribute of the set element but i believe it requires the col to be in the child table??? I also that a "loader" exists although I have used it or even seen an example. Is this the way to go?

Thanks for your help,

Jeff


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 31, 2007 10:59 am 
Regular
Regular

Joined: Tue Aug 26, 2003 7:53 pm
Posts: 66
Location: Lakeland, Florida USA
OK, I believe that "16.5. Custom SQL for loading" answers my question.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.