-->
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 with more than one subclasses
PostPosted: Thu Jan 07, 2010 4:48 pm 
Newbie

Joined: Thu Jan 07, 2010 4:32 pm
Posts: 1
Hi,

I've a class Person and a class Employee (extends Person width strategy JOINED). Like bellow:

Code:
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "person")
public class Person {

}

@Entity
@Table(name = "employee")
public class Employee extends Person {

}


That in database I have many Person already saved.

Then, on enter the person tax id, I verify if exists it into database and load the person properties to the new instance of Employee (including id, the primary key is foreign key).

But when I merge the Employee, the id is ignored and other generated (next id), and in person table duplicate the row.


Thanks.


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.