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