Community
Participate
Working Groups
@Transient fields in a @MappedSuperclass become null after merge(). They are null already in the @PrePersist method which is a blocker, since I need to use it there to obtain the user id and some other stuff. Reproducible: Always Using: @Access(AccessType.PROPERTY)
Additional info: This bug remains also when "eclipselink.weaving" = "false". It seems that somewhere within the "merge()" code a new instance of my class gets instantiated and only fields which are not @Transient get copied. This behavior sets all non-@Transient fields to their initial value. How do I get some information into @PrePersist, @PreUpdate and others which will not go into the database?
By default, we use the mappings to copy objects when we do a merge, hence unmapped objects will be ignored. The best way to override this behavior is to specify a CloneCopyPolicy on your object that will give you better control of the way the object is copied. http://www.eclipse.org/eclipselink/documentation/2.4/jpa/extensions/a_clonecopypolicy.htm#CDDJGFHA Closing as INVALID
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink