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:

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 Details

    • PCSubclassValidator

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

    • assertCanSubclass

      public void assertCanSubclass()