-->
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.  [ 3 posts ] 
Author Message
 Post subject: Can i change the discriminator type
PostPosted: Mon Jan 12, 2004 4:09 pm 
Newbie

Joined: Tue Oct 21, 2003 1:09 pm
Posts: 4
Hello-,
My scenario is like this. I have employee , contractor classes and contractor extends employee and the employee and contrator are mapper using <subclass> strategy(table-per-hierarchy).
May be this quesion is naive but still i wanted to ask can i read a row with discriminator 'contractor' and update it has an employee with discriminator 'employee'? In other words i wanted to change the contractor to employee/ but i don't want to create a new record but i wnat to chnage the existing record. can i do that?

Thanks

Karuna


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 12, 2004 4:28 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Well if you can manage in Java to have your object suddenly changing classes, you should be able to get Hibernate to persist it properly, too.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 13, 2004 10:45 am 
Regular
Regular

Joined: Tue Aug 26, 2003 3:09 pm
Posts: 58
You could probably trick it by updating the column directly using jdbc. I would imagine you would need to clear all cached references of the object to reload it. I haven't actually tried this though...

Joe


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