Class InheritanceMetadata


  • public class InheritanceMetadata
    extends ORMetadata
    Object to represent inheritance metadata. The processing of this metadata to its related class descriptors should be performed by this class. Key notes: - any metadata mapped from XML to this class must be compared in the equals method. - when loading from annotations, the constructor accepts the metadata accessor this metadata was loaded from. Used it to look up any 'companion' annotation needed for processing. - methods should be preserved in alphabetical order.
    Since:
    EclipseLink 1.0
    Author:
    Guy Pelletier
    • Constructor Detail

      • InheritanceMetadata

        public InheritanceMetadata()
        INTERNAL: Used for XML loading.
    • Method Detail

      • addClassExtractor

        protected void addClassExtractor​(MetadataDescriptor descriptor,
                                         EntityAccessor accessor)
        INTERNAL: Set the class extractor class name on the inheritance policy.
      • addTablePerClassParentMappings

        public void addTablePerClassParentMappings​(MetadataDescriptor startingDescriptor,
                                                   MetadataDescriptor realDescriptor)
        INTERNAL: Recursive method to traverse table per class inheritance hierarchy and grab all the 'inherited' accessors for subclasses of the hierarchy. What we know: - All parent classes will already have been processed. Inheritance hierarchies are processed top->down. - Always go through the given descriptors pointer to its class accessor, as we can not rely on the reloaded accessors for inheritance checks, mapped superclasses etc. Use the descriptors provided. - When adding accessors from superclasses to an inheritance subclasses descriptor, they must be reloaded/cloned and cannot be shared. Otherwise the processing of those accessor will only be performed once by their 'real' owning entity accessor.
      • equals

        public boolean equals​(java.lang.Object objectToCompare)
        INTERNAL:
        Specified by:
        equals in class ORMetadata
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getStrategy

        public java.lang.String getStrategy()
        INTERNAL: Used for OX mapping.
      • process

        public void process​(MetadataDescriptor descriptor)
        INTERNAL: The process method method will be called with the descriptor from every entity in the hierarchy.
      • processInheritanceRoot

        protected void processInheritanceRoot​(MetadataDescriptor descriptor,
                                              EntityAccessor accessor)
        INTERNAL: Process the inheritance metadata of a root class.
      • setInheritancePolicy

        protected void setInheritancePolicy​(MetadataDescriptor descriptor)
        INTERNAL: Recursive method.
      • setStrategy

        public void setStrategy​(java.lang.String strategy)
        INTERNAL: Used for OX mapping.
      • setTablePerClassInheritancePolicy

        protected void setTablePerClassInheritancePolicy​(MetadataDescriptor descriptor)
        INTERNAL:
      • usesJoinedStrategy

        public boolean usesJoinedStrategy()
        INTERNAL:
      • usesSingleTableStrategy

        public boolean usesSingleTableStrategy()
        INTERNAL:
      • usesTablePerClassStrategy

        public boolean usesTablePerClassStrategy()
        INTERNAL: