Description
If openjpa.DetachState =fetch-groups is used, the enhancer will add a 'implements Externalizable' + writeExternal + readExternal.
The problem is, that writeExternal and readExternal will also try to externalize the private members of any given superclass. Thus we get a runtime Exception that we are not allowed to access those fields.
Example:
@Entity
public abstract class AbstractGroup {
...
@Temporal(TemporalType.TIMESTAMP)
@TrackChanges
private Date applicationBegin;
...
}
and
@Entity
public class Group extends AbstractGroup {
...
}
will result in the following code (decompiled with jad):
public void writeExternal(ObjectOutput objectoutput)
throws IOException
{
pcWriteUnmanaged(objectoutput);
if(pcStateManager != null)
else
{ objectoutput.writeObject(pcGetDetachedState()); objectoutput.writeObject(null); } objectoutput.writeObject(applicationBegin);
objectoutput.writeObject(applicationEnd);
objectoutput.writeObject(applicationLocked);
objectoutput.writeObject(approvalRequired);
...
Attachments
Attachments
Issue Links
- is duplicated by
-
OPENJPA-2351 Subclasses writeExternal method trys to access a super class' private field.
- Resolved
- is related to
-
OPENJPA-1707 A warning message should be logged when a down level enhanced Entity is encountered.
- Reopened
- relates to
-
OPENJPA-1704 PCEnhancer incorrectly generates readExternal
- Closed