|
|
I'm using Spring and Hibernate. I'm calling getHibernateTemplate().saveOrUpdate(o) on an object that has not been persisted and does not exist in the db. When the transaction commits, Spring or Hibernate (not sure which one) generates an update statement instead of an insert.
What configs control this? Is there something special I need to do? This is the first time I've come across this. I haven't had any issues with any other objects.
Let me know if there is anything I can post to help.
Thanks in advance...
Spring doesn't offer any ORM capabilities by itself no matter what orm package you are using. The sql is generated by Hibernate and there can be multiple reason why it performs an update instead of an insert.
For example the relationships of the object might cause the update or when the object is inserted, the key generation strategy requires an update. |
|