开发者

Hibernate updating a single column

开发者 https://www.devze.com 2023-04-10 09:03 出处:网络
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 d

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消