Module org.eclipse.persistence.jpa
Class ElementCollectionAccessor
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.DirectAccessor
org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.DirectCollectionAccessor
org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.ElementCollectionAccessor
- All Implemented Interfaces:
MappedKeyMapAccessor
public class ElementCollectionAccessor
extends DirectCollectionAccessor
implements MappedKeyMapAccessor
An element collection accessor.
Used to support DirectCollection, DirectMap, AggregateCollection.
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:
- EclipseLink 1.2
-
Field Summary
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
ConstructorDescriptionINTERNAL: Used for OX mapping.ElementCollectionAccessor
(MetadataAnnotation elementCollection, MetadataAccessibleObject accessibleObject, ClassAccessor classAccessor) INTERNAL: -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAssociationOverride
(AssociationOverrideMetadata associationOverride) INTERNAL:protected void
addAttributeOverride
(AttributeOverrideMetadata attributeOverride) INTERNAL:void
addMapKeyConvert
(ConvertMetadata convert) INTERNAL: A map key convert from an annotation specification.boolean
INTERNAL:INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.protected ColumnMetadata
INTERNAL:INTERNAL: Used for OX mapping.protected DatabaseTable
INTERNAL: Return the default table to hold the foreign key of a MapKey when and Entity is used as the MapKeyINTERNAL: Used for OX mapping.INTERNAL:getEnumerated
(boolean isForMapKey) INTERNAL: Return the enumerated metadata for this accessor.protected String
INTERNAL:INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Used for OX mapping.INTERNAL: Return the map key class on this element collection accessor.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.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.INTERNAL: In an element collection case, when the collection is not an embeddable collection, there is no notion of a reference descriptor, therefore we return this accessors descriptorprotected MetadataClass
INTERNAL: Return the target class for this accessor.protected String
INTERNAL: Used for OX mapping.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
hasLob
(boolean isForMapKey) INTERNAL: Return true if this accessor has lob metadata.boolean
INTERNAL:protected boolean
INTERNAL: Return true if this accessor has a map key class specified.boolean
hasTemporal
(boolean isForMapKey) INTERNAL: Return true if this accessor has temporal metadata.void
initXMLObject
(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings) INTERNAL:boolean
INTERNAL: Used by our XML writing facility.boolean
INTERNAL: Return true if this element collection contains embeddable objects.void
process()
INTERNAL: Process the element collection metadata.protected void
processCollectionTable
(CollectionMapping mapping) INTERNAL: Process a MetadataCollectionTable.protected void
processDirectEmbeddableCollectionMapping
(MetadataDescriptor referenceDescriptor) INTERNAL:protected void
processMappingsFromEmbeddable
(MetadataDescriptor embeddableDescriptor, AggregateObjectMapping nestedAggregateObjectMapping, EmbeddableMapping embeddableMapping, Map<String, AttributeOverrideMetadata> attributeOverrides, Map<String, AssociationOverrideMetadata> associationOverrides, String dotNotationName) INTERNAL:protected void
processMappingValueConverters
(MetadataDescriptor embeddableDescriptor) INTERNAL: Process convertors registered for collection mapping.void
setAssociationOverrides
(List<AssociationOverrideMetadata> associationOverrides) INTERNAL: Used for OX mapping.void
setAttributeOverrides
(List<AttributeOverrideMetadata> attributeOverrides) INTERNAL: Used for OX mapping.void
setColumn
(ColumnMetadata column) INTERNAL: Used for OX mapping.void
setCompositeMember
(String compositeMember) INTERNAL: Used for OX mapping.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
setTargetClassName
(String targetClassName) 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.DirectCollectionAccessor
getBatchFetch, getCascadeOnDelete, getCollectionTable, getDefaultCollectionTableName, getDefaultFetchType, getJoinFetch, getNonCacheable, getPrivateOwned, getReferenceDatabaseTable, getValueConverter, isCascadeOnDelete, isDirectCollection, isNonCacheable, isValidDirectCollectionType, isValidDirectMapType, process, processBatchFetch, processDirectCollectionMapping, processDirectMapMapping, setBatchFetch, setCascadeOnDelete, setCollectionTable, setJoinFetch, setNonCacheable
Methods inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.DirectAccessor
addConvert, getConvert, getConverts, getEnumerated, getFetch, getLob, getLob, getOptional, getTemporal, isOptional, setConverts, setEnumerated, setFetch, setLob, setOptional, setTemporal, usesIndirection
Methods inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor
addConvertMetadata, addFieldNameTranslation, derivesId, getAnnotation, getAssociationOverrides, getAttributeName, getAttributeOverride, getAttributeOverrides, getAttributeType, getClassAccessor, getConverts, getDatabaseField, getField, getForeignKey, getGetMethodName, getJoinColumns, getJoinColumnsAndValidate, getMapKeyConverts, getMapKeyReferenceClass, getMapKeyReferenceClassName, getMapKeyReferenceClassWithGenerics, getMapping, getOwningDescriptor, getOwningDescriptors, getRawClass, getRawClassWithGenerics, getReferenceAccessors, getReferenceClassFromGeneric, getReferenceClassName, getReferenceClassWithGenerics, getSetMethodName, hasAttributeOverride, hasAttributeType, hasReturnInsert, hasReturnUpdate, initXMLMappingAccessor, isAnnotationPresent, isBasic, isBasicCollection, isBasicMap, isCollectionAccessor, isDerivedIdClass, isEmbedded, isEmbeddedId, isEnumerated, isId, isJson, isLob, isManyToMany, isManyToOne, isMapAccessor, isMappedKeyMapAccessor, isMultitenantId, isOneToMany, isOneToOne, isPrimitiveWrapperClass, isProcessed, isRelationship, isSerialized, isTemporal, isTimeClass, isTransient, isUUID, isValidJsonType, isValidSerializedType, isVariableOneToOne, processAssociationOverride, 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, setAccessorMethods, 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
-
ElementCollectionAccessor
public ElementCollectionAccessor()INTERNAL: Used for OX mapping. -
ElementCollectionAccessor
public ElementCollectionAccessor(MetadataAnnotation elementCollection, MetadataAccessibleObject accessibleObject, ClassAccessor classAccessor) INTERNAL:
-
-
Method Details
-
addAttributeOverride
INTERNAL: -
addAssociationOverride
INTERNAL: -
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 classDirectCollectionAccessor
-
hashCode
public int hashCode()- Overrides:
hashCode
in classDirectCollectionAccessor
-
getAssociationOverrides
INTERNAL: Used for OX mapping. -
getAttributeOverrides
INTERNAL: Used for OX mapping. -
getColumn
INTERNAL: Used for OX mapping. -
getCompositeMember
INTERNAL: Used for OX mapping. -
getColumn
INTERNAL:- Overrides:
getColumn
in classMappingAccessor
- See Also:
-
getDefaultTableForEntityMapKey
INTERNAL: Return the default table to hold the foreign key of a MapKey when and Entity is used as the MapKey- Overrides:
getDefaultTableForEntityMapKey
in classMappingAccessor
-
getDeleteAll
INTERNAL: Used for OX mapping. -
getEmbeddableAccessor
INTERNAL: -
getEnumerated
INTERNAL: Return the enumerated metadata for this accessor.- Overrides:
getEnumerated
in classDirectAccessor
- See Also:
-
getKeyConverter
INTERNAL:- Specified by:
getKeyConverter
in classDirectCollectionAccessor
-
getMapKey
INTERNAL: Used for OX mapping.- Specified by:
getMapKey
in interfaceMappedKeyMapAccessor
- Overrides:
getMapKey
in classMappingAccessor
- See Also:
-
getMapKeyClass
INTERNAL: Return the map key class on this element collection accessor.- Specified by:
getMapKeyClass
in interfaceMappedKeyMapAccessor
-
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
-
getMapKeyAssociationOverrides
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyAssociationOverrides
in interfaceMappedKeyMapAccessor
-
getMapKeyAttributeOverrides
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyAttributeOverrides
in interfaceMappedKeyMapAccessor
-
getMapKeyClassName
INTERNAL: Used for OX mapping. -
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.MappedSuperclass descriptors return Void when their parameterized generic reference class is null
- Overrides:
getReferenceClass
in classMappingAccessor
-
getReferenceDescriptor
INTERNAL: In an element collection case, when the collection is not an embeddable collection, there is no notion of a reference descriptor, therefore we return this accessors descriptor- Overrides:
getReferenceDescriptor
in classDirectCollectionAccessor
-
getTargetClass
INTERNAL: Return the target class for this accessor. -
getTargetClassName
INTERNAL: Used for OX mapping. -
getTemporal
INTERNAL: Return the temporal metadata for this accessor.- Overrides:
getTemporal
in classDirectAccessor
- See Also:
-
hasEnumerated
public boolean hasEnumerated(boolean isForMapKey) INTERNAL: Return true if this accessor has enumerated metadata.- Overrides:
hasEnumerated
in classDirectAccessor
- See Also:
-
hasLob
public boolean hasLob(boolean isForMapKey) INTERNAL: Return true if this accessor has lob metadata.- Overrides:
hasLob
in classDirectAccessor
- See Also:
-
hasMapKey
public boolean hasMapKey()INTERNAL:- Overrides:
hasMapKey
in classMappingAccessor
- See Also:
-
hasMapKeyClass
protected boolean hasMapKeyClass()INTERNAL: Return true if this accessor has a map key class specified.- Overrides:
hasMapKeyClass
in classDirectCollectionAccessor
- See Also:
-
hasTemporal
public boolean hasTemporal(boolean isForMapKey) INTERNAL: Return true if this accessor has temporal metadata.- Overrides:
hasTemporal
in classDirectAccessor
- See Also:
-
initXMLObject
public void initXMLObject(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings) INTERNAL:- Overrides:
initXMLObject
in classDirectCollectionAccessor
-
isDeleteAll
public boolean isDeleteAll()INTERNAL: Used by our XML writing facility. Returns false unless m_deleteAll is both set and true -
isDirectEmbeddableCollection
public boolean isDirectEmbeddableCollection()INTERNAL: Return true if this element collection contains embeddable objects.- Overrides:
isDirectEmbeddableCollection
in classMappingAccessor
-
process
public void process()INTERNAL: Process the element collection metadata.- Specified by:
process
in classMetadataAccessor
-
processCollectionTable
INTERNAL: Process a MetadataCollectionTable.- Overrides:
processCollectionTable
in classDirectCollectionAccessor
-
processDirectEmbeddableCollectionMapping
INTERNAL: -
processMappingValueConverters
INTERNAL: Process convertors registered for collection mapping.- Parameters:
embeddableDescriptor
- Metadata descriptor for embedded collection.
-
processMappingsFromEmbeddable
protected void processMappingsFromEmbeddable(MetadataDescriptor embeddableDescriptor, AggregateObjectMapping nestedAggregateObjectMapping, EmbeddableMapping embeddableMapping, Map<String, AttributeOverrideMetadata> attributeOverrides, Map<String, AssociationOverrideMetadata> associationOverrides, String dotNotationName) INTERNAL: -
setAssociationOverrides
INTERNAL: Used for OX mapping. -
setAttributeOverrides
INTERNAL: Used for OX mapping. -
setColumn
INTERNAL: Used for OX mapping. -
setCompositeMember
INTERNAL: Used for OX mapping. -
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. -
setTemporal
Description copied from class:MappingAccessor
INTERNAL: Set the temporal metadata for this accessor.- Overrides:
setTemporal
in classDirectAccessor
- See Also:
-
setOrderBy
INTERNAL: Used for OX mapping. -
setOrderColumn
INTERNAL: Used for OX mapping. -
setTargetClassName
INTERNAL: Used for OX mapping.
-