org.apache.openjpa.enhance
Class PCSubclassValidator
java.lang.Object
org.apache.openjpa.enhance.PCSubclassValidator
public class PCSubclassValidator
- extends Object
Validates that a given type meets the JPA contract, plus a few
OpenJPA-specific additions for subclassing / redefinition:
- must have an accessible no-args constructor
- must be a public or protected class
- must not be final
- must not extend an enhanced class
- all persistent data represented by accessible setter/getter
methods (persistent properties)
- if versioning is to be used, exactly one persistent property for
the numeric version data
- When using property access, the backing field for a persistent
property must be:
- private
- set only in the designated setter,
in the constructor, or in
Object.clone()
,
readObject(ObjectInputStream)
, or
Externalizable#readExternal(ObjectInput)
.
- read only in the designated getter and the
constructor.
If you use this technique and use the new
keyword instead of
a OpenJPA-supplied construction routine, OpenJPA will need to do extra work
with persistent-new-flushed instances, since OpenJPA cannot in this case
track what happens to such an instance.
- Since:
- 1.0.0
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PCSubclassValidator
public PCSubclassValidator(ClassMetaData meta,
serp.bytecode.BCClass bc,
Log log,
boolean enforceContractViolations)
assertCanSubclass
public void assertCanSubclass()
Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.