-->
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 mapping: help!
PostPosted: Tue Nov 25, 2003 1:36 am 
Newbie

Joined: Tue Nov 25, 2003 12:49 am
Posts: 2
Location: London
Hi,

I'm trying to create a Map of a many-to-many relationship where the key (index) is in the "target" table.

I have the following schema:

Code:
employee
  id
  ...

employee_rights
  employee_id
  access_right_id

access_right
  id
  code
  description

I want to have a Map in my Employee object of all access rights keyed by code (a string).

By using the following (or something like the following, I've deleted the original):

Code:
<map name="accessRights" table="employee_rights">
  <key column="employee_id"/>
  <index column="code"/>
  <many-to-many column="access_right_id" class="AccessRight"/>
</map>

I've managed to get a Map working by having the code in the employee_rights table but, apart from the endless duplication, I want to expand my knowledge and find out how to do it!

Can anybody help, please?

Many TIA!

Also, many thanks to all the committers for a really first rate framework. Thanks!

Cheers,
-Carl


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.