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.
精彩评论