Hello
I have a problem where i am using a object that has a Map holding all it property values. The reasaon is that i am mapping it to 2 different tables, once in EntityModePOJO mode and once in EntityMode.MAP. The effect i am looking for is to bind metadata to the object though the EntityMode.MAP mapping. So I am using spring and JTA running the transaction over my command pojo. The command needs to save the object for both mappings in same transaction. Offcause the EntityMode.MAo fails, or rather it succeds but make no commit to the database. Im guessing tat its because the dirty check says that nothing is dirty when i am trying to saveOrUpdate for the Entitymode.MAP mapping.
(which is done after the EntityMode.POJO).
So my questions are:
How do I handle saving the same object to two different mappings in the same transaction?
Is the problem that the Hibernat proxy marks the object as being clean after EntityMode.POJO has seen the changes?
THX
Magnus
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: