-->
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: many-to-many and "childs" order
PostPosted: Tue Apr 20, 2004 4:20 am 
Newbie

Joined: Tue Apr 20, 2004 3:51 am
Posts: 2
Hi,

I've a user bean and a role bean, a typical structure to manage ACL. Every user may have roles, so every roles may "have" users.

There are three tables: role, user, role_user (the collection/ralation table).

Due to some constrain in the application and database, I've mapped, my be wrongly, the user's roles *List* with a bag, so Hibernate retrive all role's beans when I get a user.

Is there a way to populate that role's list with a predefined order (eg. by role name), asking the database to do an "order by" while retrieving roles?

I see Hibernate to execute the join-query between role and role_user tables. Just a way to append an order by clause? order-by attribute (only for jdk 1.4+) work only (?) on role_user's columns.

Or I need to reorder with a filter? I know about SortedSet, but I don't want to change, if possible, the bean definition.

Thanks, Satollo.


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.