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_referenceClassFields inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor
KEY_DOT_NOTATION, m_field, VALUE_DOT_NOTATIONFields inherited from class org.eclipse.persistence.internal.jpa.metadata.ORMetadata
m_project -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCollectionAccessor(String xmlElement) INTERNAL: Used for OX mapping.protectedCollectionAccessor(MetadataAnnotation annotation, MetadataAccessibleObject accessibleObject, ClassAccessor classAccessor) INTERNAL: -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAssociationOverride(AssociationOverrideMetadata associationOverride) INTERNAL: Add the association override to our map key attribute overrides list.protected voidaddAttributeOverride(AttributeOverrideMetadata attributeOverride) INTERNAL: Add the attribute override to our map key attribute overrides list.voidaddMapKeyConvert(ConvertMetadata convert) INTERNAL: A map key convert from an annotation specification.booleanINTERNAL:protected ColumnMetadataINTERNAL: 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 OrderColumnMetadataINTERNAL: 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 DatabaseTableINTERNAL: Return the reference table for this accessor.getTemporal(boolean isForMapKey) INTERNAL: Return the temporal metadata for this accessor.booleanhasEnumerated(boolean isForMapKey) INTERNAL: Return true if this accessor has enumerated metadata.inthashCode()booleanINTERNAL:booleanhasTemporal(boolean isForMapKey) INTERNAL: Return true if this accessor has temporal metadata.voidinitXMLObject(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings) INTERNAL:booleanINTERNAL: Return true if this accessor represents a collection accessor.booleanINTERNAL: Used by our XML writing facility.voidprocess()INTERNAL: This process should do any common validation processing of collection accessors.protected voidprocess(CollectionMapping mapping) Configure the CollectionMapping properties based on the metadata.protected voidprocessAssociationOverride(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 voidINTERNAL: Configure the EISOneToManyMapping properties based on the metadata.voidsetDeleteAll(Boolean deleteAll) INTERNAL: Used for OX mapping.voidsetMapKey(MapKeyMetadata mapKey) INTERNAL: Used for OX mapping.voidsetMapKeyAssociationOverrides(List<AssociationOverrideMetadata> mapKeyAssociationOverrides) INTERNAL: Used for OX mapping.voidsetMapKeyAttributeOverrides(List<AttributeOverrideMetadata> mapKeyAttributeOverrides) INTERNAL: Used for OX mapping.voidsetMapKeyClass(MetadataClass mapKeyClass) INTERNAL:voidsetMapKeyClassName(String mapKeyClassName) INTERNAL: Used for OX mapping.voidsetMapKeyColumn(ColumnMetadata mapKeyColumn) INTERNAL: Used for OX mapping.voidsetMapKeyConverts(List<ConvertMetadata> mapKeyConverts) INTERNAL: Used for OX mapping.voidsetMapKeyEnumerated(EnumeratedMetadata mapKeyEnumerated) INTERNAL: Used for OX mapping.voidsetMapKeyForeignKey(ForeignKeyMetadata mapKeyForeignKey) INTERNAL: Used for OX mapping.voidsetMapKeyJoinColumns(List<JoinColumnMetadata> mapKeyJoinColumns) INTERNAL: Used for OX mapping.voidsetMapKeyTemporal(TemporalMetadata mapKeyTemporal) INTERNAL: Used for OX mapping.voidsetOrderBy(OrderByMetadata orderBy) INTERNAL: Used for OX mapping.voidsetOrderColumn(OrderColumnMetadata orderColumn) INTERNAL: Used for OX mapping.voidsetTemporal(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, usesIndirectionMethods 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, usesVirtualAccessMethods 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, setValuePartitioningMethods 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:
addMapKeyConvertin classMappingAccessor
-
equals
INTERNAL:- Overrides:
equalsin classRelationshipAccessor
-
hashCode
public int hashCode()- Overrides:
hashCodein classRelationshipAccessor
-
getColumn
INTERNAL: Return the map key column for this accessor. Default one if necessary.- Overrides:
getColumnin classMappingAccessor- See Also:
-
getDefaultFetchType
INTERNAL: Return the default fetch type for a collection mapping.- Specified by:
getDefaultFetchTypein classRelationshipAccessor
-
getDeleteAll
INTERNAL: Used for OX mapping. -
getEnumerated
INTERNAL: Return the enumerated metadata for this accessor.- Overrides:
getEnumeratedin classMappingAccessor- See Also:
-
getMapKey
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyin interfaceMappedKeyMapAccessor- Overrides:
getMapKeyin classMappingAccessor- See Also:
-
getMapKeyAssociationOverrides
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyAssociationOverridesin interfaceMappedKeyMapAccessor
-
getMapKeyAttributeOverrides
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyAttributeOverridesin interfaceMappedKeyMapAccessor
-
getMapKeyClass
INTERNAL:- Specified by:
getMapKeyClassin 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:
getMapKeyClassWithGenericsin interfaceMappedKeyMapAccessor
-
getMapKeyColumn
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyColumnin interfaceMappedKeyMapAccessor
-
getMapKeyConvert
INTERNAL:- Specified by:
getMapKeyConvertin interfaceMappedKeyMapAccessor
-
getMapKeyConverts
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyConvertsin interfaceMappedKeyMapAccessor
-
getMapKeyEnumerated
INTERNAL: Used for OX mapping. -
getMapKeyForeignKey
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyForeignKeyin interfaceMappedKeyMapAccessor
-
getMapKeyJoinColumns
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyJoinColumnsin 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:
getReferenceClassin 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:
getReferenceDatabaseTablein classMappingAccessor- See Also:
-
getTemporal
INTERNAL: Return the temporal metadata for this accessor.- Overrides:
getTemporalin classMappingAccessor- See Also:
-
setTemporal
Description copied from class:MappingAccessorINTERNAL: Set the temporal metadata for this accessor.- Overrides:
setTemporalin classMappingAccessor- See Also:
-
hasEnumerated
public boolean hasEnumerated(boolean isForMapKey) INTERNAL: Return true if this accessor has enumerated metadata.- Overrides:
hasEnumeratedin classMappingAccessor- See Also:
-
hasMapKey
public boolean hasMapKey()INTERNAL:- Overrides:
hasMapKeyin classMappingAccessor- See Also:
-
hasTemporal
public boolean hasTemporal(boolean isForMapKey) INTERNAL: Return true if this accessor has temporal metadata.- Overrides:
hasTemporalin classMappingAccessor- See Also:
-
isCollectionAccessor
public boolean isCollectionAccessor()INTERNAL: Return true if this accessor represents a collection accessor.- Overrides:
isCollectionAccessorin 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:
initXMLObjectin classRelationshipAccessor
-
process
public void process()INTERNAL: This process should do any common validation processing of collection accessors.- Overrides:
processin 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:
processAssociationOverridein 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:
setMapKeyClassin 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.
-