-->
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: Best practices for using link tables and mapping them
PostPosted: Tue May 20, 2008 12:41 am 
Newbie

Joined: Tue Apr 25, 2006 1:17 pm
Posts: 19
If I have two tables A and B and the association between the two are maintained via a link table and a third table that has a parent/child relationship with one of the non-linked tables, what's the recommended best practice for the mapping files such that inserts and deletes cascade (bidirectional) between all of the associations happen correctly?


Table A: (Person)
Code:
ID (PK - integer)
Name (string)
Gender (byte)
Last Login (date)


Table B (Team):
Code:
ID (PK - integer)
TeamName (string)
TeamType (byte)
LocationID (FK to Location)


Third table: (Location)
Code:
ID (PK - integer)
Location Name (string)
Capacity (integer)


Link table: (PersonTeamLink)
Code:
PersonID
TeamID


Thanks,
Justin


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.