-->
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.  [ 1 post ] 
Author Message
 Post subject: Ordering a collection by an inherited property...
PostPosted: Thu Oct 11, 2007 12:38 am 
Newbie

Joined: Wed Jun 08, 2005 11:42 pm
Posts: 4
Hibernate 3.2.5 - Postgres 8.2.x

I have a basic hierarchy

Class A {
Name;
...
}

Class B extends A
{
...
}

Class C extends B
{
...
}

And a class that holds the reference to a set of C's.
Class Foo
{
Set<C> items;
}

C -> A are mapped as joined subclass and work fine, Items is mapped by a set with one-to-many. However when I try to add an order to the set I ran into a problem. I would like to order on the name property, inherited through B -> C. This crashes with a SQL exception, column not found. The generated SQL is trying to reference the table for C, not A. Now if I set the order-by value to `C0_2_.name asc` it works as expected. Obviously this is not a good solution. Does anyone have any suggestions on this?

Thanks!


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

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.