-->
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.  [ 3 posts ] 
Author Message
 Post subject: order by or list indexes in an associated table
PostPosted: Tue Jun 24, 2008 7:55 pm 
Beginner
Beginner

Joined: Wed Jun 11, 2008 4:43 am
Posts: 20
I'd like to use an order bag or use a list index with a column in the referenced table.
As an example:
Class A has a collection of object of class B. Class B has the attribute orderCriteria. I'd like to have in the object of class A, the collection of objects of class B, ordered by the orderCriteria which belongs to B.

Code:
<hibernate-mapping>
  <class name="A">
    <bag order-by="???.orderCriteria">
      [...]
  </class>
</hibernate-mapping>


Code:
<hibernate-mapping>
  <class name="B">
    <property name="orderCriteria">
  </class>
</hibernate-mapping>


Any suggestion where I could find information?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 25, 2008 3:05 pm 
Beginner
Beginner

Joined: Wed Jun 11, 2008 4:43 am
Posts: 20
Is my request really so exotic that hibernate is not able to do this? lol
In fact, I was expecting to find a way to add an extra column in the select that hibernate generates, so that I may reference this column in the order by clause. But I couldn't find how to do this.
Does someone already had such a problem and resolved it?


Top
 Profile  
 
 Post subject: order by or list indexes in an associated table
PostPosted: Wed Dec 03, 2008 6:14 pm 
Newbie

Joined: Wed Dec 03, 2008 6:05 pm
Posts: 1
Hi,

I have this same question. Anybody know of a solution/workaround?

Thanks.


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