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
- Author:
- Guy Pelletier
-
-
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
Constructors Modifier Constructor Description protectedCollectionAccessor(java.lang.String xmlElement)INTERNAL: Used for OX mapping.protectedCollectionAccessor(MetadataAnnotation annotation, MetadataAccessibleObject accessibleObject, ClassAccessor classAccessor)INTERNAL:
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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.booleanequals(java.lang.Object objectToCompare)INTERNAL:protected ColumnMetadatagetColumn(java.lang.String loggingCtx)INTERNAL: Return the map key column for this accessor.java.lang.StringgetDefaultFetchType()INTERNAL: Return the default fetch type for a collection mapping.java.lang.BooleangetDeleteAll()INTERNAL: Used for OX mapping.EnumeratedMetadatagetEnumerated(boolean isForMapKey)INTERNAL: Return the enumerated metadata for this accessor.MapKeyMetadatagetMapKey()INTERNAL: Used for OX mapping.java.util.List<AssociationOverrideMetadata>getMapKeyAssociationOverrides()INTERNAL: Used for OX mapping.java.util.List<AttributeOverrideMetadata>getMapKeyAttributeOverrides()INTERNAL: Used for OX mapping.MetadataClassgetMapKeyClass()INTERNAL:java.lang.StringgetMapKeyClassName()INTERNAL: Used for OX mapping.MetadataClassgetMapKeyClassWithGenerics()INTERNAL: Future: this method is where we would provide a more explicit reference class to support an auto-apply jpa converter.ColumnMetadatagetMapKeyColumn()INTERNAL: Used for OX mapping.java.lang.StringgetMapKeyConvert()INTERNAL:java.util.List<ConvertMetadata>getMapKeyConverts()INTERNAL: Used for OX mapping.EnumeratedMetadatagetMapKeyEnumerated()INTERNAL: Used for OX mapping.ForeignKeyMetadatagetMapKeyForeignKey()INTERNAL: Used for OX mapping.java.util.List<JoinColumnMetadata>getMapKeyJoinColumns()INTERNAL: Used for OX mapping.TemporalMetadatagetMapKeyTemporal()INTERNAL: Used for OX mapping.OrderByMetadatagetOrderBy()INTERNAL: Used for OX mapping.protected OrderColumnMetadatagetOrderColumn()INTERNAL: Used for OX mapping.MetadataClassgetReferenceClass()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 org.eclipse.persistence.internal.helper.DatabaseTablegetReferenceDatabaseTable()INTERNAL: Return the reference table for this accessor.TemporalMetadatagetTemporal(boolean isForMapKey)INTERNAL: Return the temporal metadata for this accessor.booleanhasEnumerated(boolean isForMapKey)INTERNAL: Return true if this accessor has enumerated metadata.inthashCode()booleanhasMapKey()INTERNAL:booleanhasTemporal(boolean isForMapKey)INTERNAL: Return true if this accessor has temporal metadata.voidinitXMLObject(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings)INTERNAL:booleanisCollectionAccessor()INTERNAL: Return true if this accessor represents a collection accessor.booleanisDeleteAll()INTERNAL: Used by our XML writing facility.voidprocess()INTERNAL: This process should do any common validation processing of collection accessors.protected voidprocess(org.eclipse.persistence.mappings.CollectionMapping mapping)Configure the CollectionMapping properties based on the metadata.protected voidprocessAssociationOverride(AssociationOverrideMetadata associationOverride, org.eclipse.persistence.mappings.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 voidprocessEISOneToManyMapping(org.eclipse.persistence.eis.mappings.EISOneToManyMapping mapping)INTERNAL: Configure the EISOneToManyMapping properties based on the metadata.voidsetDeleteAll(java.lang.Boolean deleteAll)INTERNAL: Used for OX mapping.voidsetMapKey(MapKeyMetadata mapKey)INTERNAL: Used for OX mapping.voidsetMapKeyAssociationOverrides(java.util.List<AssociationOverrideMetadata> mapKeyAssociationOverrides)INTERNAL: Used for OX mapping.voidsetMapKeyAttributeOverrides(java.util.List<AttributeOverrideMetadata> mapKeyAttributeOverrides)INTERNAL: Used for OX mapping.voidsetMapKeyClass(MetadataClass mapKeyClass)INTERNAL:voidsetMapKeyClassName(java.lang.String mapKeyClassName)INTERNAL: Used for OX mapping.voidsetMapKeyColumn(ColumnMetadata mapKeyColumn)INTERNAL: Used for OX mapping.voidsetMapKeyConverts(java.util.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(java.util.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, 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, isLob, isManyToMany, isManyToOne, isMapAccessor, isMappedKeyMapAccessor, isMultitenantId, isOneToMany, isOneToOne, isPrimitiveWrapperClass, isProcessed, isRelationship, isSerialized, isTemporal, isTimeClass, isTransient, isValidSerializedType, isVariableOneToOne, processAssociationOverrides, processAttributeOverrides, processContainerPolicyAndIndirection, processConvert, processConverts, processDirectMapKeyClass, processEmbeddableMapKeyClass, processEntityMapKeyClass, processEnumerated, processForeignKeyRelationship, processIndirection, processJoinFetch, processLob, processMapKeyClass, processMappingConverter, processMappingKeyConverter, processMappingValueConverter, processProperties, processProperty, processReturnInsert, processReturnInsertAndUpdate, processReturnUpdate, processSerialized, processSerialized, processTemporal, 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 Detail
-
CollectionAccessor
protected CollectionAccessor(java.lang.String xmlElement)
INTERNAL: Used for OX mapping.
-
CollectionAccessor
protected CollectionAccessor(MetadataAnnotation annotation, MetadataAccessibleObject accessibleObject, ClassAccessor classAccessor)
INTERNAL:
-
-
Method Detail
-
addAssociationOverride
protected void addAssociationOverride(AssociationOverrideMetadata associationOverride)
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
protected void addAttributeOverride(AttributeOverrideMetadata attributeOverride)
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
public void addMapKeyConvert(ConvertMetadata convert)
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
public boolean equals(java.lang.Object objectToCompare)
INTERNAL:- Overrides:
equalsin classRelationshipAccessor
-
hashCode
public int hashCode()
- Overrides:
hashCodein classRelationshipAccessor
-
getColumn
protected ColumnMetadata getColumn(java.lang.String loggingCtx)
INTERNAL: Return the map key column for this accessor. Default one if necessary.- Overrides:
getColumnin classMappingAccessor- See Also:
BasicAccessor,BasicCollectionAccessor,BasicMapAccessor,ElementCollectionAccessor,CollectionAccessor
-
getDefaultFetchType
public java.lang.String getDefaultFetchType()
INTERNAL: Return the default fetch type for a collection mapping.- Specified by:
getDefaultFetchTypein classRelationshipAccessor
-
getDeleteAll
public java.lang.Boolean getDeleteAll()
INTERNAL: Used for OX mapping.
-
getEnumerated
public EnumeratedMetadata getEnumerated(boolean isForMapKey)
INTERNAL: Return the enumerated metadata for this accessor.- Overrides:
getEnumeratedin classMappingAccessor- See Also:
DirectAccessor,ElementCollectionAccessor,CollectionAccessor
-
getMapKey
public MapKeyMetadata getMapKey()
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyin interfaceMappedKeyMapAccessor- Overrides:
getMapKeyin classMappingAccessor- See Also:
CollectionAccessor,ElementCollectionAccessor
-
getMapKeyAssociationOverrides
public java.util.List<AssociationOverrideMetadata> getMapKeyAssociationOverrides()
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyAssociationOverridesin interfaceMappedKeyMapAccessor
-
getMapKeyAttributeOverrides
public java.util.List<AttributeOverrideMetadata> getMapKeyAttributeOverrides()
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyAttributeOverridesin interfaceMappedKeyMapAccessor
-
getMapKeyClass
public MetadataClass getMapKeyClass()
INTERNAL:- Specified by:
getMapKeyClassin interfaceMappedKeyMapAccessor
-
getMapKeyClassName
public java.lang.String getMapKeyClassName()
INTERNAL: Used for OX mapping.
-
getMapKeyClassWithGenerics
public MetadataClass 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
public ColumnMetadata getMapKeyColumn()
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyColumnin interfaceMappedKeyMapAccessor
-
getMapKeyConvert
public java.lang.String getMapKeyConvert()
INTERNAL:- Specified by:
getMapKeyConvertin interfaceMappedKeyMapAccessor
-
getMapKeyConverts
public java.util.List<ConvertMetadata> getMapKeyConverts()
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyConvertsin interfaceMappedKeyMapAccessor
-
getMapKeyEnumerated
public EnumeratedMetadata getMapKeyEnumerated()
INTERNAL: Used for OX mapping.
-
getMapKeyForeignKey
public ForeignKeyMetadata getMapKeyForeignKey()
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyForeignKeyin interfaceMappedKeyMapAccessor
-
getMapKeyJoinColumns
public java.util.List<JoinColumnMetadata> getMapKeyJoinColumns()
INTERNAL: Used for OX mapping.- Specified by:
getMapKeyJoinColumnsin interfaceMappedKeyMapAccessor
-
getMapKeyTemporal
public TemporalMetadata getMapKeyTemporal()
INTERNAL: Used for OX mapping.
-
getOrderBy
public OrderByMetadata getOrderBy()
INTERNAL: Used for OX mapping.
-
getOrderColumn
protected OrderColumnMetadata getOrderColumn()
INTERNAL: Used for OX mapping.
-
getReferenceClass
public MetadataClass 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
protected org.eclipse.persistence.internal.helper.DatabaseTable 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:
DirectCollectionAccessor,ManyToManyAccessor
-
getTemporal
public TemporalMetadata getTemporal(boolean isForMapKey)
INTERNAL: Return the temporal metadata for this accessor.- Overrides:
getTemporalin classMappingAccessor- See Also:
DirectAccessor,CollectionAccessor
-
setTemporal
public void setTemporal(TemporalMetadata metadata, boolean isForMapKey)
Description copied from class:MappingAccessorINTERNAL: Set the temporal metadata for this accessor.- Overrides:
setTemporalin classMappingAccessor- See Also:
DirectAccessor,CollectionAccessor
-
hasEnumerated
public boolean hasEnumerated(boolean isForMapKey)
INTERNAL: Return true if this accessor has enumerated metadata.- Overrides:
hasEnumeratedin classMappingAccessor- See Also:
DirectAccessor,ElementCollectionAccessor,CollectionAccessor
-
hasMapKey
public boolean hasMapKey()
INTERNAL:- Overrides:
hasMapKeyin classMappingAccessor- See Also:
CollectionAccessor,ElementCollectionAccessor,BasicMapAccessor
-
hasTemporal
public boolean hasTemporal(boolean isForMapKey)
INTERNAL: Return true if this accessor has temporal metadata.- Overrides:
hasTemporalin classMappingAccessor- See Also:
DirectAccessor,ElementCollectionAccessor,CollectionAccessor
-
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
protected void process(org.eclipse.persistence.mappings.CollectionMapping mapping)
Configure the CollectionMapping properties based on the metadata.
-
processAssociationOverride
protected void processAssociationOverride(AssociationOverrideMetadata associationOverride, org.eclipse.persistence.mappings.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
protected void processEISOneToManyMapping(org.eclipse.persistence.eis.mappings.EISOneToManyMapping mapping)
INTERNAL: Configure the EISOneToManyMapping properties based on the metadata.
-
setDeleteAll
public void setDeleteAll(java.lang.Boolean deleteAll)
INTERNAL: Used for OX mapping.
-
setMapKey
public void setMapKey(MapKeyMetadata mapKey)
INTERNAL: Used for OX mapping.
-
setMapKeyAssociationOverrides
public void setMapKeyAssociationOverrides(java.util.List<AssociationOverrideMetadata> mapKeyAssociationOverrides)
INTERNAL: Used for OX mapping.
-
setMapKeyAttributeOverrides
public void setMapKeyAttributeOverrides(java.util.List<AttributeOverrideMetadata> mapKeyAttributeOverrides)
INTERNAL: Used for OX mapping.
-
setMapKeyClass
public void setMapKeyClass(MetadataClass mapKeyClass)
INTERNAL:- Specified by:
setMapKeyClassin interfaceMappedKeyMapAccessor
-
setMapKeyClassName
public void setMapKeyClassName(java.lang.String mapKeyClassName)
INTERNAL: Used for OX mapping.
-
setMapKeyColumn
public void setMapKeyColumn(ColumnMetadata mapKeyColumn)
INTERNAL: Used for OX mapping.
-
setMapKeyConverts
public void setMapKeyConverts(java.util.List<ConvertMetadata> mapKeyConverts)
INTERNAL: Used for OX mapping.
-
setMapKeyEnumerated
public void setMapKeyEnumerated(EnumeratedMetadata mapKeyEnumerated)
INTERNAL: Used for OX mapping.
-
setMapKeyForeignKey
public void setMapKeyForeignKey(ForeignKeyMetadata mapKeyForeignKey)
INTERNAL: Used for OX mapping.
-
setMapKeyJoinColumns
public void setMapKeyJoinColumns(java.util.List<JoinColumnMetadata> mapKeyJoinColumns)
INTERNAL: Used for OX mapping.
-
setMapKeyTemporal
public void setMapKeyTemporal(TemporalMetadata mapKeyTemporal)
INTERNAL: Used for OX mapping.
-
setOrderBy
public void setOrderBy(OrderByMetadata orderBy)
INTERNAL: Used for OX mapping.
-
setOrderColumn
public void setOrderColumn(OrderColumnMetadata orderColumn)
INTERNAL: Used for OX mapping.
-
-