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

public abstract Class ObjectAccessor

extends RelationshipAccessor
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.OneToOneAccessor, org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.VariableOneToOneAccessor, org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.ManyToOneAccessor
Static Imports
org.eclipse.persistence.internal.jpa.metadata.MetadataConstants.JPA_FETCH_EAGER, .MetadataConstants.JPA_ID, .MetadataConstants.JPA_MAPS_ID, .MetadataConstants.JPA_PRIMARY_KEY_JOIN_COLUMN, .MetadataConstants.JPA_PRIMARY_KEY_JOIN_COLUMNS

INTERNAL: A single object relationship accessor. Key notes: - any metadata mapped from XML to this class must be compared in the equals method. - any metadata mapped from XML to this class must be handled in the merge method. (merging is done at the accessor/mapping level) - any metadata mapped from XML to this class must be initialized in the initXMLObject method. - methods should be preserved in alphabetical order.
Author
Guy Pelletier
Since
TopLink EJB 3.0 Reference Implementation

Field Summary

Modifier and TypeField and Description
private Boolean
private String
private Boolean
private PrimaryKeyForeignKeyMetadata
private List<PrimaryKeyJoinColumnMetadata>
Inherited from org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.RelationshipAccessor:
m_referenceClass

Constructor Summary

AccessConstructor and Description
protected
ObjectAccessor(String xmlElement)

INTERNAL: Used for OX mapping.

protected
ObjectAccessor(MetadataAnnotation annotation, MetadataAnnotatedElement annotatedElement, ClassAccessor classAccessor)

INTERNAL:

Method Summary

Modifier and TypeMethod and Description
public boolean
derivesId()

Overrides org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor.derivesId.

INTERNAL: Return true is this accessor is a derived id accessor.
public boolean
equals(Object
the reference object with which to compare.
objectToCompare
)

Overrides org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.RelationshipAccessor.equals.

INTERNAL:
private Set<MappingAccessor>
public String
getAttributeType()

Overrides org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor.getAttributeType.

INTERNAL: The attribute type for virtual object accessors is the target entity.
public String
getDefaultFetchType()

Implements abstract org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.RelationshipAccessor.getDefaultFetchType.

INTERNAL: Return the default fetch type for an object mapping.
public Boolean
getId()

INTERNAL:

public String
getMapsId()

INTERNAL: Used for OX mapping.

public Boolean
getOptional()

INTERNAL: Used for OX mapping.

public PrimaryKeyForeignKeyMetadata
getPrimaryKeyForeignKey()

INTERNAL: Used for OX mapping.

public List<PrimaryKeyJoinColumnMetadata>
getPrimaryKeyJoinColumns()

INTERNAL: Used for OX mapping.

public MetadataClass
getReferenceClass()

Overrides org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor.getReferenceClass.

INTERNAL: If a target entity is specified in metadata, it will be set as the reference class, otherwise we will use the raw class.
protected MetadataClass
getSimplePKType()

INTERNAL: Used to process primary keys and DerivedIds.

public boolean
hasAttributeType()

Overrides org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor.hasAttributeType.

INTERNAL: Object accessors don't require a separate attribute-type specification in XML, instead they can use the reference class to determine the attribute-type.
public int
protected boolean
hasId()

INTERNAL:

protected boolean
hasMapsId()

INTERNAL:

protected ObjectReferenceMapping
initManyToOneMapping()

INTERNAL: Initialize a ManyToOneMapping.

protected ObjectReferenceMapping
initOneToOneMapping()

INTERNAL: Initialize a OneToOneMapping.

public void
public boolean
isOneToOnePrimaryKeyRelationship()

INTERNAL: Return true if this accessor represents a 1-1 primary key relationship.

public boolean
isOptional()

INTERNAL:

protected void
processAssociationOverride(AssociationOverrideMetadata associationOverride, EmbeddableMapping embeddableMapping, MetadataDescriptor owningDescriptor)

Overrides org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor.processAssociationOverride.

INTERNAL: Process an association override for either an embedded object mapping, or a map mapping (element-collection, 1-M and M-M) containing an embeddable object as the value or key.
protected void
processAssociationOverride(AssociationOverrideMetadata associationOverride, EmbeddableMapping embeddableMapping, DatabaseTable defaultTable, MetadataDescriptor owningDescriptor)

INTERNAL: Process an association override for either an embedded object mapping, or a map mapping (element-collection, 1-M and M-M) containing an embeddable object as the value or key.

protected void
processForeignKeyRelationship(ObjectReferenceMapping mapping)

INTERNAL: Process the join columns for the owning side of a one to one mapping.

protected void
processId(OneToOneMapping mapping)

INTERNAL: Used to process primary keys and DerivedIds.

protected void
processMapsId(OneToOneMapping oneToOneMapping)

INTERNAL: Process the mapping keys from the maps id value.

protected void
processMapsIdFields(OneToOneMapping oneToOneMapping, EmbeddedIdAccessor embeddedIdAccessor, MappingAccessor mapsIdAccessor)

INTERNAL: We're going to add field name translations where necessary.

protected void
processOneToOnePrimaryKeyRelationship(OneToOneMapping mapping)

INTERNAL: Process the primary key join columns for the owning side of a one to one mapping.

protected void
processOwningMappingKeys(OneToOneMapping mapping)

INTERNAL: Process the the correct metadata for the owning side of a one to one mapping.

public void
setId(Boolean id)

INTERNAL: Used for OX mapping.

public void
setMapsId(String mapsId)

INTERNAL: Used for OX mapping.

public void
setOptional(Boolean isOptional)

INTERNAL: Used for OX mapping.

public void
setPrimaryKeyForeignKey(PrimaryKeyForeignKeyMetadata primaryKeyForeignKey)

INTERNAL: Used for OX mapping.

public void
setPrimaryKeyJoinColumns(List<PrimaryKeyJoinColumnMetadata> primaryKeyJoinColumns)

INTERNAL: Used for OX mapping.

Inherited from org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.RelationshipAccessor:
addJoinTableRelationKeyFieldsgetBatchFetchgetCascadegetCascadeOnDeletegetDefaultTableForEntityMapKeygetFetchgetForeignKeygetJoinColumnsgetJoinFetchgetJoinFieldsgetJoinTablegetJoinTableMetadatagetLoggingContextgetMappedBygetNonCacheablegetOrphanRemovalgetOwningMappinggetPrivateOwnedgetReferenceDescriptorgetTargetEntitygetTargetEntityNamehasJoinTablehasMappedByisCascadeOnDeleteisLazyisNonCacheableisOrphanRemovalisPrivateOwnedisValueHolderInterfaceprocessprocessBatchFetchprocessCascadeTypesprocessJoinTableprocessMappedByRelationTableprocessOrphanRemovalprocessRelationshipMappingsetAccessorMethodssetBatchFetchsetCascadesetCascadeOnDeletesetFetchsetForeignKeysetJoinColumnssetJoinFetchsetJoinFieldssetJoinTablesetMappedBysetNonCacheablesetOrphanRemovalsetPrivateOwnedsetTargetEntitysetTargetEntityNameusesIndirection

Field Detail

m_idback to summary
private Boolean m_id
m_mapsIdback to summary
private String m_mapsId
m_optionalback to summary
private Boolean m_optional
m_primaryKeyForeignKeyback to summary
private PrimaryKeyForeignKeyMetadata m_primaryKeyForeignKey
m_primaryKeyJoinColumnsback to summary
private List<PrimaryKeyJoinColumnMetadata> m_primaryKeyJoinColumns

Constructor Detail

ObjectAccessorback to summary
protected ObjectAccessor(String xmlElement)

INTERNAL: Used for OX mapping.

ObjectAccessorback to summary
protected ObjectAccessor(MetadataAnnotation annotation, MetadataAnnotatedElement annotatedElement, ClassAccessor classAccessor)

INTERNAL:

Method Detail

derivesIdback to summary
public boolean derivesId()

Overrides org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor.derivesId.

INTERNAL: Return true is this accessor is a derived id accessor.

Annotations
@Override
equalsback to summary
public boolean equals(Object objectToCompare)

Overrides org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.RelationshipAccessor.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
findAllFieldAccessorsback to summary
private Set<MappingAccessor> findAllFieldAccessors(MetadataDescriptor md)
getAttributeTypeback to summary
public String getAttributeType()

Overrides org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor.getAttributeType.

INTERNAL: The attribute type for virtual object accessors is the target entity.

Annotations
@Override
getDefaultFetchTypeback to summary
public String getDefaultFetchType()

Implements abstract org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.RelationshipAccessor.getDefaultFetchType.

INTERNAL: Return the default fetch type for an object mapping.

Annotations
@Override
getIdback to summary
public Boolean getId()

INTERNAL:

getMapsIdback to summary
public String getMapsId()

INTERNAL: Used for OX mapping.

getOptionalback to summary
public Boolean getOptional()

INTERNAL: Used for OX mapping.

getPrimaryKeyForeignKeyback to summary
public PrimaryKeyForeignKeyMetadata getPrimaryKeyForeignKey()

INTERNAL: Used for OX mapping.

getPrimaryKeyJoinColumnsback to summary
public List<PrimaryKeyJoinColumnMetadata> getPrimaryKeyJoinColumns()

INTERNAL: Used for OX mapping.

getReferenceClassback to summary
public MetadataClass getReferenceClass()

Overrides org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor.getReferenceClass.

INTERNAL: If a target entity is specified in metadata, it will be set as the reference class, otherwise we will use the raw class.

Annotations
@Override
getSimplePKTypeback to summary
protected MetadataClass getSimplePKType()

INTERNAL: Used to process primary keys and DerivedIds.

hasAttributeTypeback to summary
public boolean hasAttributeType()

Overrides org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor.hasAttributeType.

INTERNAL: Object accessors don't require a separate attribute-type specification in XML, instead they can use the reference class to determine the attribute-type.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.RelationshipAccessor.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
hasIdback to summary
protected boolean hasId()

INTERNAL:

hasMapsIdback to summary
protected boolean hasMapsId()

INTERNAL:

initManyToOneMappingback to summary
protected ObjectReferenceMapping initManyToOneMapping()

INTERNAL: Initialize a ManyToOneMapping.

initOneToOneMappingback to summary
protected ObjectReferenceMapping initOneToOneMapping()

INTERNAL: Initialize a OneToOneMapping.

initXMLObjectback to summary
public void initXMLObject(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings)

Overrides org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.RelationshipAccessor.initXMLObject.

INTERNAL:

Annotations
@Override
isOneToOnePrimaryKeyRelationshipback to summary
public boolean isOneToOnePrimaryKeyRelationship()

INTERNAL: Return true if this accessor represents a 1-1 primary key relationship.

isOptionalback to summary
public boolean isOptional()

INTERNAL:

processAssociationOverrideback to summary
protected void processAssociationOverride(AssociationOverrideMetadata associationOverride, EmbeddableMapping embeddableMapping, MetadataDescriptor owningDescriptor)

Overrides org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor.processAssociationOverride.

INTERNAL: Process an association override for either an embedded object mapping, or a map mapping (element-collection, 1-M and M-M) containing an embeddable object as the value or key.

Annotations
@Override
processAssociationOverrideback to summary
protected void processAssociationOverride(AssociationOverrideMetadata associationOverride, EmbeddableMapping embeddableMapping, DatabaseTable defaultTable, MetadataDescriptor owningDescriptor)

INTERNAL: Process an association override for either an embedded object mapping, or a map mapping (element-collection, 1-M and M-M) containing an embeddable object as the value or key.

processForeignKeyRelationshipback to summary
protected void processForeignKeyRelationship(ObjectReferenceMapping mapping)

INTERNAL: Process the join columns for the owning side of a one to one mapping. The default pk and pk field names are used only with single primary key entities. The processor should never get as far as to use them with entities that have a composite primary key (validation exception will be thrown).

processIdback to summary
protected void processId(OneToOneMapping mapping)

INTERNAL: Used to process primary keys and DerivedIds.

processMapsIdback to summary
protected void processMapsId(OneToOneMapping oneToOneMapping)

INTERNAL: Process the mapping keys from the maps id value.

processMapsIdFieldsback to summary
protected void processMapsIdFields(OneToOneMapping oneToOneMapping, EmbeddedIdAccessor embeddedIdAccessor, MappingAccessor mapsIdAccessor)

INTERNAL: We're going to add field name translations where necessary. If the user specified (erroneously that is) attribute overrides this will override them.

processOneToOnePrimaryKeyRelationshipback to summary
protected void processOneToOnePrimaryKeyRelationship(OneToOneMapping mapping)

INTERNAL: Process the primary key join columns for the owning side of a one to one mapping. The default pk and pk field names are used only with single primary key entities. The processor should never get as far as to use them with entities that have a composite primary key (validation exception will be thrown).

processOwningMappingKeysback to summary
protected void processOwningMappingKeys(OneToOneMapping mapping)

INTERNAL: Process the the correct metadata for the owning side of a one to one mapping. Note, the order of checking is important, that is, check for a mapsId first.

setIdback to summary
public void setId(Boolean id)

INTERNAL: Used for OX mapping.

setMapsIdback to summary
public void setMapsId(String mapsId)

INTERNAL: Used for OX mapping.

setOptionalback to summary
public void setOptional(Boolean isOptional)

INTERNAL: Used for OX mapping.

setPrimaryKeyForeignKeyback to summary
public void setPrimaryKeyForeignKey(PrimaryKeyForeignKeyMetadata primaryKeyForeignKey)

INTERNAL: Used for OX mapping.

setPrimaryKeyJoinColumnsback to summary
public void setPrimaryKeyJoinColumns(List<PrimaryKeyJoinColumnMetadata> primaryKeyJoinColumns)

INTERNAL: Used for OX mapping.