开发者

Hibernate updating a single column

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜