Summary: | merge() nullifies @Transient fields in @MappedSuperclass | ||
---|---|---|---|
Product: | z_Archived | Reporter: | Hajo Lemcke <hajo> |
Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> |
Status: | CLOSED INVALID | QA Contact: | |
Severity: | blocker | ||
Priority: | P3 | CC: | tom.ware |
Version: | unspecified | Keywords: | api, core |
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows 7 | ||
Whiteboard: |
Description
Hajo Lemcke
2013-05-11 04:04:20 EDT
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 |