|
Hibernate will ignore value of version property of a persistent object, right?
In our system, we update only a part of properties of entity by values received from UI(include version value).
So we can not use POJO as DTO directly in UI.
Each time to update, load the entity from DB(by id) and merge value from DTO to POJO, include version value.
After merging, update to DB.
But when updating, instance is a persistent object, not transient,
So hibernate will not throw StaleObjectStateException if version change!
Any suggestion?
Regard.
(English is my second language!)
|