-->
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: inheritance
PostPosted: Fri May 09, 2008 5:13 pm 
Regular
Regular

Joined: Tue Apr 01, 2008 5:39 pm
Posts: 61
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

3.2.6

Oracle 10g


General mapping question.

I have a three tables.

user, customer, employee.

Right now customer inherits from user.
employee inherits from user.


I have three different tables
user has its own id call user_id
customer has its own id call customer_id
employee has its own id call employee_id

I want to have three different mapping files.

how would you map this relationship in hibernate.

customer_id to user_id is one to one.
so is employee_id to user_id.


Top
 Profile  
 
 Post subject: joined subclass
PostPosted: Sun May 11, 2008 8:28 am 
Senior
Senior

Joined: Sun Jun 11, 2006 10:41 am
Posts: 164
Hi,
Is this a legacy database schema or you have some ability to make changes to it? Ideally, I would use the Joined Sub Class inheritence strategy in hibernate, and hibernate will take care of building the appropriate queries for me.


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.