-->
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: Getting a list of values behind a intermediary table
PostPosted: Thu Sep 04, 2008 8:58 am 
Newbie

Joined: Wed Aug 29, 2007 2:53 am
Posts: 9
Hibernate version:3.2.5

I'm having trouble to map a list of values, bag with element.
This is the situation in DB:

t_actor: actor-id
t_actor_vs_roles :actor-id,role_id
t_roles: role_id,role_name

Now I want to map an ActorDTO which has a list of role. role is from an enum Role

I can't find a way, example of how to map this. I tried with a formula but that did not work:
<bag name="roles" lazy="false">
<key column="actor_code"/>
<element formula="SELECT r.role_name from T_ROLES r,T_ACTOR_VS_ROLE ar where ar.role_id = r.role_id and ar.actor_code = actor_code">
<type name="util.SimpleEnumUserType">
<param name="enumClassName">security.Role
</param>
</type>
</element>
</bag>

SimpleEnumUserType turns the string into a the enum.
I guess formula is not made to return multiple values.
An idea anyone?

Bart


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.