-->
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.  [ 2 posts ] 
Author Message
 Post subject: DB architechture advice needed
PostPosted: Fri Apr 30, 2004 11:20 am 
Beginner
Beginner

Joined: Thu Feb 26, 2004 11:32 am
Posts: 32
Hi:
Sorry for the offtopic discussion but I think this still might be a good forum to ask this question.

I have a Demographics table in my DB which currently has a foreign key relationship with tables like Employee, Administrator etc.So the hibernate persistence class Employee 'contains' Demographics and there is EmployeeID field and a constraint in my Demographics table.

However, the requirements are likely to change and more Entities may contain Demographics in future but I dont want to keep adding columns to my Demographics table. I would still like Employee to contain Demographics in its object hierarchy, so the logical relationship is maintained in the object model.

Any advice on implementing this in DB would be great

Tia

splash


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 01, 2004 6:12 pm 
Regular
Regular

Joined: Wed Dec 31, 2003 4:26 am
Posts: 108
Location: Berkeley, CA
See the section of the reference docs on parent-child relationships and on inheritance. If you had a base class, say Person, for employee or administrator then you could use 2 of the 3 supported inheritance mapping strategies and not have to add new fk columns to the Demographics table.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

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.