Module org.eclipse.persistence.jpa
Class InheritanceMetadata
- java.lang.Object
-
- org.eclipse.persistence.internal.jpa.metadata.ORMetadata
-
- org.eclipse.persistence.internal.jpa.metadata.inheritance.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
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.internal.jpa.metadata.ORMetadata
m_project
-
-
Constructor Summary
Constructors Constructor Description InheritanceMetadata()INTERNAL: Used for XML loading.InheritanceMetadata(MetadataAnnotation inheritance, MetadataAccessor accessor)INTERNAL: Used for annotation loading.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddClassExtractor(MetadataDescriptor descriptor, EntityAccessor accessor)INTERNAL: Set the class extractor class name on the inheritance policy.protected voidaddClassIndicator(MetadataDescriptor descriptor, EntityAccessor accessor)INTERNAL: Recursive method.protected voidaddClassIndicatorField(MetadataDescriptor descriptor, EntityAccessor accessor)INTERNAL:voidaddTablePerClassParentMappings(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.booleanequals(Object objectToCompare)INTERNAL:StringgetStrategy()INTERNAL: Used for OX mapping.inthashCode()voidprocess(MetadataDescriptor descriptor)INTERNAL: The process method method will be called with the descriptor from every entity in the hierarchy.protected voidprocessInheritanceRoot(MetadataDescriptor descriptor, EntityAccessor accessor)INTERNAL: Process the inheritance metadata of a root class.protected voidprocessInheritanceSubclass(MetadataDescriptor descriptor, EntityAccessor accessor, EntityAccessor rootAccessor)INTERNAL: Process the inheritance metadata of a sub class.protected voidsetInheritancePolicy(MetadataDescriptor descriptor)INTERNAL: Recursive method.voidsetStrategy(String strategy)INTERNAL: Used for OX mapping.protected voidsetTablePerClassInheritancePolicy(MetadataDescriptor descriptor)INTERNAL:booleanusesJoinedStrategy()INTERNAL:booleanusesSingleTableStrategy()INTERNAL:booleanusesTablePerClassStrategy()INTERNAL:-
Methods inherited from class org.eclipse.persistence.internal.jpa.metadata.ORMetadata
getAccessibleObject, getAccessibleObjectName, getAnnotation, getBoxedType, getDatabaseTypeEnum, getEntityMappings, getFullyQualifiedClassName, getIdentifier, getJavaClass, getJavaClassName, getLoader, getLocation, getLogger, getMetadataClass, getMetadataClass, getMetadataClass, getMetadataFactory, getName, getPrimitiveClassForName, getProject, getText, getXMLElement, hasIdentifier, hasText, initXMLClassName, initXMLObject, initXMLObject, initXMLObjects, initXMLTextObject, loadedFromAnnotation, loadedFromEclipseLinkXML, loadedFromXML, merge, mergeORObjectLists, mergeORObjects, mergeSimpleObjects, reloadEntity, reloadMappedSuperclass, setAccessibleObject, setEntityMappings, setFieldName, setFieldName, setProject, shouldOverride, valuesMatch, valuesMatch
-
-
-
-
Constructor Detail
-
InheritanceMetadata
public InheritanceMetadata()
INTERNAL: Used for XML loading.
-
InheritanceMetadata
public InheritanceMetadata(MetadataAnnotation inheritance, MetadataAccessor accessor)
INTERNAL: Used for annotation loading.
-
-
Method Detail
-
addClassExtractor
protected void addClassExtractor(MetadataDescriptor descriptor, EntityAccessor accessor)
INTERNAL: Set the class extractor class name on the inheritance policy.
-
addClassIndicator
protected void addClassIndicator(MetadataDescriptor descriptor, EntityAccessor accessor)
INTERNAL: Recursive method.
-
addClassIndicatorField
protected void addClassIndicatorField(MetadataDescriptor descriptor, EntityAccessor accessor)
INTERNAL:
-
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(Object objectToCompare)
INTERNAL:- Specified by:
equalsin classORMetadata
-
getStrategy
public 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.
-
processInheritanceSubclass
protected void processInheritanceSubclass(MetadataDescriptor descriptor, EntityAccessor accessor, EntityAccessor rootAccessor)
INTERNAL: Process the inheritance metadata of a sub class.
-
setInheritancePolicy
protected void setInheritancePolicy(MetadataDescriptor descriptor)
INTERNAL: Recursive method.
-
setStrategy
public void setStrategy(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:
-
-