Class PCSubclassValidator


  • public class PCSubclassValidator
    extends java.lang.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
    • Constructor Summary

      Constructors 
      Constructor Description
      PCSubclassValidator​(ClassMetaData meta, org.apache.xbean.asm9.tree.ClassNode classNode, Log log, boolean enforceContractViolations)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void assertCanSubclass()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PCSubclassValidator

        public PCSubclassValidator​(ClassMetaData meta,
                                   org.apache.xbean.asm9.tree.ClassNode classNode,
                                   Log log,
                                   boolean enforceContractViolations)
    • Method Detail

      • assertCanSubclass

        public void assertCanSubclass()