-->
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: Table design problem
PostPosted: Mon Jul 31, 2006 5:22 am 
Newbie

Joined: Fri Jun 03, 2005 4:08 am
Posts: 12
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-


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.