开发者

Customizing detection change

I can now if a session contain any changes which must be synchronized with the database with session.isDirty()

But i have a simple field (modification date) that i would like to be ignore by it. Example: object Person( name,age,datemodification).

if i just modify the datemodification field i would like that session.isDirty() or othermethod like this to return false so at the end no sql update will occur.

Thanks in advance. 开发者_开发百科Regards


If you were using Hibernate Annotations you could annotate datemodification with @Transient which would mean any changes to that field would not be persisted.


I think that you would need to use an Interceptor and override the onFlushDirty() method. This looks like a forum that discusses the same question.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜