Hi all,
I have a problem that's a bit unique and I'm wondering what's the best way to handle it using hibernate. Maybe some of you guys can help out.
I have two tables:
Table Persons: Belongs to a DB where I can only READ data, hence in my mapping file, it's marked as "mutable=false". This table contains data regarding people (firstname, last name, etc). I don't own this data and therefore cannot edit it.
Table Bookings: Belongs to a separate DB where I have WRITE access.
Now the relationship between Person and Bookings is many-to-many, meaning a person can belong to several bookings, and a booking can have several persons. Naturally, I have a link table PersonBookings which only contains the foreign keys to both tables.
Now my main problem is in my application, I need to add a property (or column in DB-speak) to the object representing Persons. For example, "upgraded to first class".
The most obvious solution is to add a 3rd column in PersonBookings where I would store the new property. Then I will have something like "Person X is assigned to Booking Y and has been upgraded to 1st class".
What would be the best approach to do this in Hibernate? Create a third object PersonBookings so I can just add the property to that object?
Thanks in advance.
Regards
-Yves-
|