czetsuya
czetsuya

Reputation: 5073

In javaee6 is there a way to know which fields have update on an entity?

I'm currently working on an entity logging mechanism. And I have added an entity listener with PreUpdate, etc. Is it possible to know which fields have been updated?

Thanks.

Upvotes: 0

Views: 50

Answers (1)

Luca Basso Ricci
Luca Basso Ricci

Reputation: 18403

I think an org.hibernate.Interceptor fits your need.
Just extends EmptyInterceptor and works with onFlushDirty() and others methods.
I hope can help.

EDIT:
With annotation you can get a look here: you can work with entity lifecycle and store/compare properties on your needs

Upvotes: 1

Related Questions