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...
|