Module org.eclipse.persistence.jpa
Class CollectionAccessor
java.lang.Object
org.eclipse.persistence.internal.jpa.metadata.ORMetadata
org.eclipse.persistence.internal.jpa.metadata.accessors.MetadataAccessor
org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor
org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.RelationshipAccessor
org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.CollectionAccessor
- All Implemented Interfaces:
MappedKeyMapAccessor
- Direct Known Subclasses:
ManyToManyAccessor
,OneToManyAccessor
public abstract class CollectionAccessor
extends RelationshipAccessor
implements MappedKeyMapAccessor
INTERNAL:
A relational collection mapping 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.
- Since:
- TopLink EJB 3.0 Reference Implementation
-
Field Summary
Fields inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.RelationshipAccessor
m_referenceClass
Fields inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor
KEY_DOT_NOTATION, m_field, VALUE_DOT_NOTATION
Fields inherited from class org.eclipse.persistence.internal.jpa.metadata.ORMetadata
m_project
-
Constructor Summary
ModifierConstructorDescriptionprotected
CollectionAccessor
(String xmlElement) INTERNAL: Used for OX mapping.protected
CollectionAccessor
(MetadataAnnotation annotation, MetadataAccessibleObject accessibleObject, ClassAccessor classAccessor) INTERNAL: -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAssociationOverride
(AssociationOverrideMetadata associationOverride) INTERNAL: Add the association override to our map key attribute overrides list.protected void
addAttributeOverride
(AttributeOverrideMetadata attributeOverride) INTERNAL: Add the attribute override to our map key attribute overrides list.void
addMapKeyConvert
(ConvertMetadata convert) INTERNAL: A map key convert from an annotation specification.boolean
INTERNAL:protected ColumnMetadata
INTERNAL: Return the map key column for this accessor.INTERNAL: Return the default fetch type for a collection mapping.INTERNAL: Used for OX mapping.getEnumerated
(boolean isForMapKey) INTERNAL: Return the enumerated metadata for this accessor.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL:INTERNAL: Used for OX mapping.INTERNAL: Future: this method is where we would provide a more explicit reference class to support an auto-apply jpa converter.INTERNAL: Used for OX mapping.INTERNAL:INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.protected OrderColumnMetadata
INTERNAL: Used for OX mapping.INTERNAL: If a targetEntity is specified in metadata, it will be set as the reference class, otherwise we will look to extract one from generics.protected DatabaseTable
INTERNAL: Return the reference table for this accessor.getTemporal
(boolean isForMapKey) INTERNAL: Return the temporal metadata for this accessor.boolean
hasEnumerated
(boolean isForMapKey) INTERNAL: Return true if this accessor has enumerated metadata.int
hashCode()
boolean
INTERNAL:boolean
hasTemporal
(boolean isForMapKey) INTERNAL: Return true if this accessor has temporal metadata.void
initXMLObject
(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings) INTERNAL:boolean
INTERNAL: Return true if this accessor represents a collection accessor.boolean
INTERNAL: Used by our XML writing facility.void
process()
INTERNAL: This process should do any common validation processing of collection accessors.protected void
process
(CollectionMapping mapping) Configure the CollectionMapping properties based on the metadata.protected void
processAssociationOverride
(AssociationOverrideMetadata associationOverride, EmbeddableMapping embeddableMapping, 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
INTERNAL: Configure the EISOneToManyMapping properties based on the metadata.void
setDeleteAll
(Boolean deleteAll) INTERNAL: Used for OX mapping.void
setMapKey
(MapKeyMetadata mapKey) INTERNAL: Used for OX mapping.void
setMapKeyAssociationOverrides
(List<AssociationOverrideMetadata> mapKeyAssociationOverrides) INTERNAL: Used for OX mapping.void
setMapKeyAttributeOverrides
(List<AttributeOverrideMetadata> mapKeyAttributeOverrides) INTERNAL: Used for OX mapping.void
setMapKeyClass
(MetadataClass mapKeyClass) INTERNAL:void
setMapKeyClassName
(String mapKeyClassName) INTERNAL: Used for OX mapping.void
setMapKeyColumn
(ColumnMetadata mapKeyColumn) INTERNAL: Used for OX mapping.void
setMapKeyConverts
(List<ConvertMetadata> mapKeyConverts) INTERNAL: Used for OX mapping.void
setMapKeyEnumerated
(EnumeratedMetadata mapKeyEnumerated) INTERNAL: Used for OX mapping.void
setMapKeyForeignKey
(ForeignKeyMetadata mapKeyForeignKey) INTERNAL: Used for OX mapping.void
setMapKeyJoinColumns
(List<JoinColumnMetadata> mapKeyJoinColumns) INTERNAL: Used for OX mapping.void
setMapKeyTemporal
(TemporalMetadata mapKeyTemporal) INTERNAL: Used for OX mapping.void
setOrderBy
(OrderByMetadata orderBy) INTERNAL: Used for OX mapping.void
setOrderColumn
(OrderColumnMetadata orderColumn) INTERNAL: Used for OX mapping.void
setTemporal
(TemporalMetadata metadata, boolean isForMapKey) INTERNAL: Set the temporal metadata for this accessor.Methods inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.RelationshipAccessor
addJoinTableRelationKeyFields, getBatchFetch, getCascade, getCascadeOnDelete, getDefaultTableForEntityMapKey, getFetch, getForeignKey, getJoinColumns, getJoinFetch, getJoinFields, getJoinTable, getJoinTableMetadata, getLoggingContext, getMappedBy, getNonCacheable, getOrphanRemoval, getOwningMapping, getPrivateOwned, getReferenceDescriptor, getTargetEntity, getTargetEntityName, hasJoinTable, hasMappedBy, isCascadeOnDelete, isLazy, isNonCacheable, isOrphanRemoval, isPrivateOwned, isValueHolderInterface, processBatchFetch, processCascadeTypes, processJoinTable, processMappedByRelationTable, processOrphanRemoval, processRelationshipMapping, setAccessorMethods, setBatchFetch, setCascade, setCascadeOnDelete, setFetch, setForeignKey, setJoinColumns, setJoinFetch, setJoinFields, setJoinTable, setMappedBy, setNonCacheable, setOrphanRemoval, setPrivateOwned, setTargetEntity, setTargetEntityName, usesIndirection
Methods inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor
addConvert, addConvertMetadata, addFieldNameTranslation, derivesId, getAnnotation, getAssociationOverrides, getAttributeName, getAttributeOverride, getAttributeOverrides, getAttributeType, getClassAccessor, getConverts, getDatabaseField, getField, getForeignKey, getGetMethodName, getJoinColumns, getJoinColumnsAndValidate, getLob, getMapKeyConverts, getMapKeyReferenceClass, getMapKeyReferenceClassName, getMapKeyReferenceClassWithGenerics, getMapping, getOwningDescriptor, getOwningDescriptors, getRawClass, getRawClassWithGenerics, getReferenceAccessors, getReferenceClassFromGeneric, getReferenceClassName, getReferenceClassWithGenerics, getSetMethodName, hasAttributeOverride, hasAttributeType, hasLob, hasReturnInsert, hasReturnUpdate, initXMLMappingAccessor, isAnnotationPresent, isBasic, isBasicCollection, isBasicMap, isDerivedIdClass, isDirectCollection, isDirectEmbeddableCollection, isEmbedded, isEmbeddedId, isEnumerated, isId, isJson, isLob, isManyToMany, isManyToOne, isMapAccessor, isMappedKeyMapAccessor, isMultitenantId, isOneToMany, isOneToOne, isPrimitiveWrapperClass, isProcessed, isRelationship, isSerialized, isTemporal, isTimeClass, isTransient, isUUID, isValidJsonType, isValidSerializedType, isVariableOneToOne, processAssociationOverrides, processAttributeOverrides, processContainerPolicyAndIndirection, processConvert, processConverts, processDirectMapKeyClass, processEmbeddableMapKeyClass, processEntityMapKeyClass, processEnumerated, processForeignKeyRelationship, processIndirection, processJoinFetch, processJson, processLob, processMapKeyClass, processMappingConverter, processMappingKeyConverter, processMappingValueConverter, processProperties, processProperty, processReturnInsert, processReturnInsertAndUpdate, processReturnUpdate, processSerialized, processSerialized, processTemporal, processUUID, setAttributeType, setClassAccessor, setField, setIndirectionPolicy, setMapping, setOverrideMapping, toString, updatePrimaryKeyField, usesFieldAccess, usesPropertyAccess, usesVirtualAccess
Methods inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.MetadataAccessor
getAccess, getAccessibleObject, getAccessMethods, getAnnotatedElement, getAnnotatedElementName, getAnnotation, getConverters, getDefaultAttributeName, getDescriptor, getDescriptorJavaClass, getHashPartitioning, getIdentifier, getJavaClass, getJavaClassName, getName, getObjectTypeConverters, getPartitioned, getPartitioning, getPinnedPartitioning, getProperties, getRangePartitioning, getReferencedField, getReferencedField, getReplicationPartitioning, getRoundRobinPartitioning, getSerializedConverters, getStructConverters, getTypeConverters, getUnionPartitioning, getUpperCaseShortJavaClassName, getValue, getValue, getValuePartitioning, hasAccess, hasAccessMethods, initAccess, initXMLAccessor, isAnnotationPresent, merge, processConverters, processCustomConverters, processObjectTypeConverters, processPartitioned, processPartitioning, processPrimaryKeyJoinColumns, processSerializedConverters, processStructConverters, processTable, processTypeConverters, setAccess, setAccessMethods, setConverters, setDescriptor, setHashPartitioning, setName, setObjectTypeConverters, setPartitioned, setPartitioning, setPinnedPartitioning, setProperties, setRangePartitioning, setReplicationPartitioning, setRoundRobinPartitioning, setSerializedConverters, setStructConverters, setTypeConverters, setUnionPartitioning, setValuePartitioning
Methods inherited from class org.eclipse.persistence.internal.jpa.metadata.ORMetadata
getAccessibleObjectName, getAnnotation, getBoxedType, getDatabaseTypeEnum, getEntityMappings, getFullyQualifiedClassName, getJavaClass, getJavaClassName, getLoader, getLocation, getLogger, getMetadataClass, getMetadataClass, getMetadataClass, getMetadataFactory, getName, getPrimitiveClassForName, getProject, getText, getXMLElement, hasIdentifier, hasText, initXMLClassName, initXMLObject, initXMLObjects, initXMLTextObject, loadedFromAnnotation, loadedFromEclipseLinkXML, loadedFromXML, mergeORObjectLists, mergeORObjects, mergeSimpleObjects, reloadEntity, reloadMappedSuperclass, setAccessibleObject, setEntityMappings, setFieldName, setFieldName, setProject, shouldOverride, valuesMatch, valuesMatch
-
Constructor Details
-
CollectionAccessor
INTERNAL: Used for OX mapping. -
CollectionAccessor
protected CollectionAccessor(MetadataAnnotation annotation, MetadataAccessibleObject accessibleObject, ClassAccessor classAccessor) INTERNAL:
-
-
Method Details
-
addAssociationOverride
INTERNAL: Add the association override to our map key attribute overrides list. If it uses the 'key.' notation rip it off, otherwise use what is specified. -
addAttributeOverride
INTERNAL: Add the attribute override to our map key attribute overrides list. If it uses the 'key.' notation rip it off, otherwise use what is specified. -
addMapKeyConvert
INTERNAL: A map key convert from an annotation specification. In XML, this list is populated using the map-key-convert element. In annotations there is only a single Convert annotation and map key converts are identified with an attribute name on the convert beginning with "key".- Overrides:
addMapKeyConvert
in classMappingAccessor
-
equals
INTERNAL:- Overrides:
equals
in classRelationshipAccessor
-
hashCode
public int hashCode()- Overrides:
hashCode
in classRelationshipAccessor
-
getColumn
INTERNAL: Return the map key column for this accessor. Default one if necessary.- Overrides:
getColumn
in classMappingAccessor
- See Also:
-
getDefaultFetchType
INTERNAL: Return the default fetch type for a collection mapping.- Specified by:
getDefaultFetchType
in classRelationshipAccessor
-
getDeleteAll
INTERNAL: Used for OX mapping. -
getEnumerated
INTERNAL: Return the enumerated metadata for this accessor.- Overrides:
getEnumerated
in classMappingAccessor
- See Also:
-
getMapKey
INTERNAL: Used for OX mapping.- Specified by:
getMapKey
in interfaceMappedKeyMapAccessor
- Overrides:
getMapKey
in classMappingAccessor
- See Also:
-
getMapKeyAssociationOverrides
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyAssociationOverrides
in interfaceMappedKeyMapAccessor
-
getMapKeyAttributeOverrides
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyAttributeOverrides
in interfaceMappedKeyMapAccessor
-
getMapKeyClass
INTERNAL:- Specified by:
getMapKeyClass
in interfaceMappedKeyMapAccessor
-
getMapKeyClassName
INTERNAL: Used for OX mapping. -
getMapKeyClassWithGenerics
INTERNAL: Future: this method is where we would provide a more explicit reference class to support an auto-apply jpa converter. Per the spec auto-apply converters are applied against basics only.- Specified by:
getMapKeyClassWithGenerics
in interfaceMappedKeyMapAccessor
-
getMapKeyColumn
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyColumn
in interfaceMappedKeyMapAccessor
-
getMapKeyConvert
INTERNAL:- Specified by:
getMapKeyConvert
in interfaceMappedKeyMapAccessor
-
getMapKeyConverts
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyConverts
in interfaceMappedKeyMapAccessor
-
getMapKeyEnumerated
INTERNAL: Used for OX mapping. -
getMapKeyForeignKey
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyForeignKey
in interfaceMappedKeyMapAccessor
-
getMapKeyJoinColumns
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyJoinColumns
in interfaceMappedKeyMapAccessor
-
getMapKeyTemporal
INTERNAL: Used for OX mapping. -
getOrderBy
INTERNAL: Used for OX mapping. -
getOrderColumn
INTERNAL: Used for OX mapping. -
getReferenceClass
INTERNAL: If a targetEntity is specified in metadata, it will be set as the reference class, otherwise we will look to extract one from generics.- Overrides:
getReferenceClass
in classMappingAccessor
-
getReferenceDatabaseTable
INTERNAL: Return the reference table for this accessor. If it is a many to many mapping, return the join table otherwise return the reference descriptors primary key table.- Overrides:
getReferenceDatabaseTable
in classMappingAccessor
- See Also:
-
getTemporal
INTERNAL: Return the temporal metadata for this accessor.- Overrides:
getTemporal
in classMappingAccessor
- See Also:
-
setTemporal
Description copied from class:MappingAccessor
INTERNAL: Set the temporal metadata for this accessor.- Overrides:
setTemporal
in classMappingAccessor
- See Also:
-
hasEnumerated
public boolean hasEnumerated(boolean isForMapKey) INTERNAL: Return true if this accessor has enumerated metadata.- Overrides:
hasEnumerated
in classMappingAccessor
- See Also:
-
hasMapKey
public boolean hasMapKey()INTERNAL:- Overrides:
hasMapKey
in classMappingAccessor
- See Also:
-
hasTemporal
public boolean hasTemporal(boolean isForMapKey) INTERNAL: Return true if this accessor has temporal metadata.- Overrides:
hasTemporal
in classMappingAccessor
- See Also:
-
isCollectionAccessor
public boolean isCollectionAccessor()INTERNAL: Return true if this accessor represents a collection accessor.- Overrides:
isCollectionAccessor
in classMappingAccessor
-
isDeleteAll
public boolean isDeleteAll()INTERNAL: Used by our XML writing facility. Returns false unless m_deleteAll is both set and true -
initXMLObject
public void initXMLObject(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings) INTERNAL:- Overrides:
initXMLObject
in classRelationshipAccessor
-
process
public void process()INTERNAL: This process should do any common validation processing of collection accessors.- Overrides:
process
in classRelationshipAccessor
-
process
Configure the CollectionMapping properties based on the metadata. -
processAssociationOverride
protected void processAssociationOverride(AssociationOverrideMetadata associationOverride, EmbeddableMapping embeddableMapping, 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.- Overrides:
processAssociationOverride
in classMappingAccessor
-
processEISOneToManyMapping
INTERNAL: Configure the EISOneToManyMapping properties based on the metadata. -
setDeleteAll
INTERNAL: Used for OX mapping. -
setMapKey
INTERNAL: Used for OX mapping. -
setMapKeyAssociationOverrides
public void setMapKeyAssociationOverrides(List<AssociationOverrideMetadata> mapKeyAssociationOverrides) INTERNAL: Used for OX mapping. -
setMapKeyAttributeOverrides
INTERNAL: Used for OX mapping. -
setMapKeyClass
INTERNAL:- Specified by:
setMapKeyClass
in interfaceMappedKeyMapAccessor
-
setMapKeyClassName
INTERNAL: Used for OX mapping. -
setMapKeyColumn
INTERNAL: Used for OX mapping. -
setMapKeyConverts
INTERNAL: Used for OX mapping. -
setMapKeyEnumerated
INTERNAL: Used for OX mapping. -
setMapKeyForeignKey
INTERNAL: Used for OX mapping. -
setMapKeyJoinColumns
INTERNAL: Used for OX mapping. -
setMapKeyTemporal
INTERNAL: Used for OX mapping. -
setOrderBy
INTERNAL: Used for OX mapping. -
setOrderColumn
INTERNAL: Used for OX mapping.
-