-->
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 Bidirectional entity issue
PostPosted: Sun Sep 17, 2006 3:00 am 
Regular
Regular

Joined: Sun Sep 17, 2006 2:48 am
Posts: 81
Location: California
I am trying to create 2 entities(User and Role) which has many-to-many bidirectional relationship among them. So 1 User can have multiple roles and 1 role can be associated with multiple users. When I use <many-to-many> elements in the mapping files I am forced to use
Set<Role> roleSet;
in my User entity and
Set<User> userSet;
in my Role entity.

Is there any way I can simply specify a set of foreign key ( Set<Long> roleId; in User.java and Set<Long> userId; in Role.java) instead of a complete set of entities? If possible, how would the mapping XML look like?

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.