I am confused as to the stance Hibernate takes when it determines which column information to persist. Some places I read online says it will only update dirty fields, some people say that it is also database dependant (ie. Using hibernate with Oracle 9 will persist all fields of an object, even if only 1 is dirty).
Is there a correct way t开发者_如何学运维o handle this if you only want column xxx to change? Or should that simply be abstracted to a different table? Lastly, is any of this affected whether you use Session#get
or Session#load
?
Use dynammic-update
Hibernate mapping attribute:
<class ... dynamic-update="true">
Source: Hibernate – dynamic-update attribute example.
精彩评论