-->
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.  [ 5 posts ] 
Author Message
 Post subject: new bee changing the type of a entity
PostPosted: Wed May 14, 2008 2:15 pm 
Beginner
Beginner

Joined: Wed May 14, 2008 2:06 pm
Posts: 21
I have table called organization this has a column which determines type of organization
so we created abstract organization and different implementations based on type .
now suppose i want to change the type what's the best way to handle this , right now
Organization
TypeA
TypeB


I call findbyId method on organizationService this returns instance of TypeA
now I want to promote TypeA to TypeB

what option I have ?

Help is greatly appreicated


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 14, 2008 5:05 pm 
Newbie

Joined: Wed May 14, 2008 4:14 pm
Posts: 5
What do you mean by promote?

A detailed example of what your system is doing right now and what you want it to do will help us help you.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 14, 2008 5:05 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Create a new record representing the new type, and delete the old record.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 14, 2008 5:35 pm 
Beginner
Beginner

Joined: Wed May 14, 2008 2:06 pm
Posts: 21
Cameron McKenzie wrote:
Create a new record representing the new type, and delete the old record.


If i have to delete the old record i have to update references to all the tables referring to this instance , not all tables are mapped to entities we are still migrating , and in my case i have to modify several tables and also i have to audit any changes to some tables what is the best way to handle this ?


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 14, 2008 5:36 pm 
Beginner
Beginner

Joined: Wed May 14, 2008 2:06 pm
Posts: 21
Celdric wrote:
What do you mean by promote?

A detailed example of what your system is doing right now and what you want it to do will help us help you.



update TypeA to TypeB


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.