Hibernate, or your own code if you would implement this directly, would need a way to understand what you did set, and what you did not define, so in both cases you should start by loading the original entity, and set the fields to be changed. Hibernate will then compare the old values with the new values, and perform the needed update statements.
So: 1) start a transaction 2) load the entity to be changed 3) apply changes on it 4) commit the transaction
If you also need the update statement to not rewrite unchanged fields/columns, search also for dynamic-update in the reference documentation.
_________________ Sanne http://in.relation.to/
|