-->
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 - convert/update to child class
PostPosted: Wed Jan 27, 2010 8:15 pm 
Newbie

Joined: Wed Jan 27, 2010 8:09 pm
Posts: 5
Hi all,

I am looking for a bit of 'best practice' advice.

Currently I have the following mapped classes:
Code:
@Inheritance(strategy=InheritanceType.JOINED)
public class Account


Code:
@PrimaryKeyJoinColumn(name="account_id")
public class ParentAccount extends Account


In my system generally 'Accounts' will be saved. However at later dates Accounts may need to be converted to ParentAccounts as they need extra responsibilities that Accounts do not include.

In terms of best practice whats the best way to upgrade a persistent stored item to a subclass?

Would you have to remove the previous item then re-add the account? Or is there another more efficient way of doing this?

Many thanks to all who read I appreciate your help.

Eggsy


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.