-->
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: How to implement inheritance in Hibernate ?
PostPosted: Sat Jun 05, 2010 3:24 am 
Newbie

Joined: Sun Mar 14, 2010 3:37 am
Posts: 4
Hi guys i am working in a web application.
I have entities as BaseEntity -->Which contains user login info like createdBy,createdTime,EditedBy,editedTime
Employee --> which contains employee information like name,address,etc...
RegularEmployee -->which contains salary ,bonus tht kind of fields and
ContactEmployee --> which contains HourlyRate,contactPeriod etc....

My inheritance structure is BaseEntity <--- Employee <---- RegularEmployee

(i.e. Employee extends BaseEntity and RegularEmployee extends Employee ContractEmployee also extend Employee Class ).

How to design database structure in this case considering all the tables have id and version fields (all tables should at least have these two fields).
I have gone through the inheritance strategies of hibernate but for 1st level inheritance i can achieve but wat to do for 2nd level inheritance in hibernate ?
How to design database in this case ?


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.