-->
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: Inheritance mapping / "Upgrade" between concrete c
PostPosted: Mon Nov 24, 2008 7:17 am 
Newbie

Joined: Thu Nov 13, 2008 9:21 pm
Posts: 2
I have 2 concrete persistent classes in model:
User
Employee extends User.

At some point in application I have to "upgrade" instance of User to instance of Employee, i.e. smth. like

Employee newEmployee = new Employee(existentUser)

and keep all properties and relations for user in Employee object.

Is it possible to do at all with table per concrete class strategy? or the (only) option is discriminator column?

I started with manually copying fields, but on flush (i.e. when saving new Employee) I get predictable "instance with same ID already exists in Session" for User object...


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.