One solution might be to create a second Hibernate object that has the fields needed by your DTO. Your business logic layer could be a sub-class of the the "DTO-Entity" containing the sensitive fields. This way, if the parent class won't muck with the fields from the specialization.
Another feature that maybe useful to you is enabling dynamic-update="true" on the class element of your mapping file. Or, if you using annotations, add the following:
Code:
@org.hibernate.annotations.Entity(dynamicUpdate = true,)
This tells Hibernate to generate a SQL statement for only those values that have changed.
You could also manually generate the HQL that updates the specific properties:
http://www.hibernate.org/hib_docs/v3/re ... tch-direct
Anything else would have to managed by you as only you know what field need to be truly updated.
Ryan-