-->
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: using joined-class
PostPosted: Tue Jan 16, 2007 2:33 pm 
Newbie

Joined: Wed Dec 07, 2005 1:33 am
Posts: 7
I have two tables Employee and Contact. Actually Employee table is extended to Contact. Some of the fields of both tables:

Employee
(
EmployeeID (PK)
ContactID (FK)
Title
BirthDate
...
)

Contact
(
ContactID (PK)
FirstName
LastName

)

Could I use joined-class to map those two classes? I like to declare inheritance between those two classes

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 19, 2007 3:03 am 
Senior
Senior

Joined: Mon Aug 21, 2006 9:18 am
Posts: 179
You can use joined-subclass, but the primary key in the Employee Table would be the ContactId (since that *is* the key for a subclassed Contact).

An alternative would be to use Decorator for Employee and delegate references to an inner Contact...I usually encourage that before subclassing unnecessarily.

_________________
If this helped...please remember to rate it!


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.