I like the whole lifecycle of annotations:
@PrePersist
@PostPersist
@PreRemove
@PostRemove
@PreUpdate
@PostUpdate
@PostLoad
But I think they are complements to Interceptors. Sometimes it easier
to just add an interceptor that gets executed for any CRUD for all
entities.
In your case with the last modified date for example. You could easily
use the reflection api to inspect the bean for any field modifyDate
and set that automatically instead of coding that method on all beans.
So I think there is room for both.
By adding multiple interceptors, like filters in web programming, you
could also move validator executions and other pre executions here.
But as I say, I like them both.
Jira request?
Cheers,
Fredrik
On May 30, 9:43 am, Marc de Verdelhan <
marc.deverdel...@yahoo.com>
wrote:
> <
fredrik.hul...@collabra.se>wrote: