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
|