-->
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: session.update() does not use entity name parameter
PostPosted: Thu Jan 27, 2011 9:34 am 
Newbie

Joined: Wed Dec 30, 2009 7:00 am
Posts: 4
Hi all,

I have used the org.hibernate.Session.update(String entityName,Object object) method in the past and it worked like a charm. For some reason, it no longer does what I expect it to do. I have updated to hibernate 3.6 but still no success.

This is what I am trying to do. I have a "Monitor" class that is mapped to 2 tables (using monitor.hbm.xml and entity-name attribute): WORKING_MONITOR and CURRENT_MONITOR. I want to retrieve a working_monitor object and update it in the CURRENT_MONITOR table. The id's are the same and exist in both tables.

The retrieving of the object is no problem and the entity names are respected (also veriefied with sessin.getEntityName(object). But when I try to save the object using the update("current_monitor", retrieved_working_monitor); then the record from the WORKING_MONITOR table is changed, not the CURRENT_MONITOR table.

This means that the entity-name the object is associated with is respected and the entity name in the update method is ignored. I did another test that confirms this.

Any idea's ?


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.