Hello Hibernate users,
All @PreXXX annotations have following javadoc in common
"Is used to specify callback methods for the corresponding lifecycle event. This annotation may be applied to methods of an entity class, a mapped superclass, or a callback listener class."
An @Entity E has @Embedded an @Embeddable M, which extends a @MappedSuperclass S. Methods on S annotated with @PrePersist or @PreUpdate annotation do not ever get called. Since S is @MappedSuperclass, either javadoc is incomplete and thus misleading, or there is a bug in Hibernate 3.6.0 related to this. If I move @PrePersist/@PreUpdate method(s) to @Entity, they get called.
Regards, Stevo.
|