Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa.metadata.inheritance

public Class InheritanceMetadata

extends ORMetadata
Class Inheritance
Static Imports
org.eclipse.persistence.internal.jpa.metadata.MetadataConstants.JPA_INHERITANCE_JOINED, .MetadataConstants.JPA_INHERITANCE_SINGLE_TABLE, .MetadataConstants.JPA_INHERITANCE_TABLE_PER_CLASS

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.
Author
Guy Pelletier
Since
EclipseLink 1.0

Field Summary

Modifier and TypeField and Description
private String
Inherited from org.eclipse.persistence.internal.jpa.metadata.ORMetadata:
m_project

Constructor Summary

AccessConstructor and Description
public
InheritanceMetadata()

INTERNAL: Used for XML loading.

public
InheritanceMetadata(MetadataAnnotation inheritance, MetadataAccessor accessor)

INTERNAL: Used for annotation loading.

Method Summary

Modifier and TypeMethod and Description
protected void
addClassExtractor(MetadataDescriptor descriptor, EntityAccessor accessor)

INTERNAL: Set the class extractor class name on the inheritance policy.

protected void
addClassIndicator(MetadataDescriptor descriptor, EntityAccessor accessor)

INTERNAL: Recursive method.

protected void
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.

public boolean
equals(Object
the reference object with which to compare.
objectToCompare
)

Implements abstract org.eclipse.persistence.internal.jpa.metadata.ORMetadata.equals.

INTERNAL:
public String
getStrategy()

INTERNAL: Used for OX mapping.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public void
process(MetadataDescriptor descriptor)

INTERNAL: The process method method will be called with the descriptor from every entity in the hierarchy.

protected void
processInheritanceRoot(MetadataDescriptor descriptor, EntityAccessor accessor)

INTERNAL: Process the inheritance metadata of a root class.

protected void
processInheritanceSubclass(MetadataDescriptor descriptor, EntityAccessor accessor, EntityAccessor rootAccessor)

INTERNAL: Process the inheritance metadata of a sub class.

protected void
setInheritancePolicy(MetadataDescriptor descriptor)

INTERNAL: Recursive method.

public void
setStrategy(String strategy)

INTERNAL: Used for OX mapping.

protected void
public boolean
usesJoinedStrategy()

INTERNAL:

public boolean
public boolean
Inherited from org.eclipse.persistence.internal.jpa.metadata.ORMetadata:
getAccessibleObjectgetAccessibleObjectNamegetAnnotationgetBoxedTypegetDatabaseTypeEnumgetEntityMappingsgetFullyQualifiedClassNamegetIdentifiergetJavaClassgetJavaClassNamegetLoadergetLocationgetLoggergetMetadataClassgetMetadataClassgetMetadataClassgetMetadataFactorygetNamegetPrimitiveClassForNamegetProjectgetTextgetXMLElementhasIdentifierhasTextinitXMLClassNameinitXMLObjectinitXMLObjectinitXMLObjectsinitXMLTextObjectloadedFromAnnotationloadedFromEclipseLinkXMLloadedFromXMLmergemergeORObjectListsmergeORObjectsmergeSimpleObjectsreloadEntityreloadMappedSuperclasssetAccessibleObjectsetEntityMappingssetFieldNamesetFieldNamesetProjectshouldOverridevaluesMatchvaluesMatch

Field Detail

m_strategyback to summary
private String m_strategy

Constructor Detail

InheritanceMetadataback to summary
public InheritanceMetadata()

INTERNAL: Used for XML loading.

InheritanceMetadataback to summary
public InheritanceMetadata(MetadataAnnotation inheritance, MetadataAccessor accessor)

INTERNAL: Used for annotation loading.

Method Detail

addClassExtractorback to summary
protected void addClassExtractor(MetadataDescriptor descriptor, EntityAccessor accessor)

INTERNAL: Set the class extractor class name on the inheritance policy.

addClassIndicatorback to summary
protected void addClassIndicator(MetadataDescriptor descriptor, EntityAccessor accessor)

INTERNAL: Recursive method.

addClassIndicatorFieldback to summary
protected void addClassIndicatorField(MetadataDescriptor descriptor, EntityAccessor accessor)

INTERNAL:

addTablePerClassParentMappingsback to summary
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.

equalsback to summary
public boolean equals(Object objectToCompare)

Implements abstract org.eclipse.persistence.internal.jpa.metadata.ORMetadata.equals.

INTERNAL:

Parameters
objectToCompare:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getStrategyback to summary
public String getStrategy()

INTERNAL: Used for OX mapping.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
processback to summary
public void process(MetadataDescriptor descriptor)

INTERNAL: The process method method will be called with the descriptor from every entity in the hierarchy.

processInheritanceRootback to summary
protected void processInheritanceRoot(MetadataDescriptor descriptor, EntityAccessor accessor)

INTERNAL: Process the inheritance metadata of a root class.

processInheritanceSubclassback to summary
protected void processInheritanceSubclass(MetadataDescriptor descriptor, EntityAccessor accessor, EntityAccessor rootAccessor)

INTERNAL: Process the inheritance metadata of a sub class.

setInheritancePolicyback to summary
protected void setInheritancePolicy(MetadataDescriptor descriptor)

INTERNAL: Recursive method.

setStrategyback to summary
public void setStrategy(String strategy)

INTERNAL: Used for OX mapping.

setTablePerClassInheritancePolicyback to summary
protected void setTablePerClassInheritancePolicy(MetadataDescriptor descriptor)

INTERNAL:

usesJoinedStrategyback to summary
public boolean usesJoinedStrategy()

INTERNAL:

usesSingleTableStrategyback to summary
public boolean usesSingleTableStrategy()

INTERNAL:

usesTablePerClassStrategyback to summary
public boolean usesTablePerClassStrategy()

INTERNAL: