-->
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: How should I map using hibernate?
PostPosted: Tue Dec 15, 2009 11:56 pm 
Newbie

Joined: Tue Aug 05, 2008 3:11 pm
Posts: 7
Database tables (please ignore table design problem)
Person (personId primary key, personName)
Club (clubId primary key, clubName, inactiveDate) (Note: club could be closed for some period of time, called inactive)
PersonClub (clubId, personId, inactiveDate) (Note: person could be in or out of a club, if out, called inactive)
primary key(clubId, personId)

Tasks:
When a club is closing, be able to update inactiveDate as current time for current clubId in Club table; at the same time update inactiveDate as current time for each person within this club in PersonClub table, Person table should not be touched;
Note currently this is unidirectional association, i.e. from club to person only, not reverse.

Any idea how should I do mapping or it's possible? many-to-many? collection of depending objects?

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.