-
Nov 9th, 2010, 07:49 PM
#1
Mapping Join Table that contains multiple joins
I have a legacy table that acts as a join table between multiple tables. For example if I have tables for people, dogs, cars, houses, etc. then there is just one table "relationships" that maps the many to many relationships for:
people to dogs
people to people
people to cars
cars to houses
etc...
The join table has two ids, as well as a value that indicates the type of relationship, for example:
people_dogs
people_people
people_cars
cars_people
....
I don't mind creating separate domain classes for each relationship if I have to, but how I do I tell it to only pull the values out of the join table based on the "type"?
Is there any way do to this? BTW this data is all read-only, I don't ever do saves, updates or deletes so cascading is irrelevant,.
Last edited by predhead; Nov 9th, 2010 at 07:58 PM.
Reason: Add more info.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules