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.  [ 5 posts ] 
Author Message
 Post subject: order-by with a many-to-many set
PostPosted: Thu Dec 04, 2003 10:39 am 
Newbie

Joined: Thu Oct 23, 2003 6:12 am
Posts: 18
Normal n to n relationship:
Code:
foo <-- foo2bar --> bar

Can I order the Set foo.bar using a column of bar; bar.name for instance?

the .hbm. xml for the attribute foo.bar:
Code:
<set
            name="bar"
            table="foo2bar"
            lazy="false"
            inverse="false"
            cascade="none"
            sort="unsorted"
            order-by="name asc"
        >
              <key
                  column="foo"
              />
              <many-to-many
                  class="bar"
                  column="bar"
                  outer-join="auto"
              />
</set>

I get "Uknown column 'bar2a0_.name' in in 'order clause'"

Offcource bar _has_ column name,

Is it possible to sort a many-to-many set using a column on the other side?

thanks,

Bas


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 04, 2003 11:07 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
no, it is not supported


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 20, 2005 5:28 pm 
Newbie

Joined: Sat Jan 08, 2005 3:40 pm
Posts: 7
Location: New York
gavin wrote:
no, it is not supported


Any chance this might be supported in a future release? Also to allow for db ordering of composite-elements...

<set name="foobar" table="foobar">
<key column="foobarId"/>
<composite-element class="Foobar">
<many-to-one name="foo" column="fooId" class="Foo" order-by="fooName asc"/>
<many-to-one name="bar" column="barId" class="Bar" order-by="barName asc"/>
</composite-element>
</set>

Sometimes it's better to let the db and not the jvm do the heavy lifting...

-S


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 03, 2008 2:15 pm 
Newbie

Joined: Fri Dec 02, 2005 8:03 am
Posts: 10
Is it still not supported? If so, is there any Jira issue on this?

thanks,
Fabrício Lemos


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 26, 2008 9:39 pm 
Newbie

Joined: Thu Dec 14, 2006 7:08 pm
Posts: 11
Is this supported yet? Someone?


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