Class OneToManyAccessor
- 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
-
- org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.OneToManyAccessor
-
- All Implemented Interfaces:
MappedKeyMapAccessor
public class OneToManyAccessor extends CollectionAccessor
INTERNAL: A OneToMany relationship accessor. A OneToMany annotation currently is not required to be on the accessible object, that is, a 1-M can default. 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 Constructor Description OneToManyAccessor()
INTERNAL: Used for OX mapping.OneToManyAccessor(MetadataAnnotation oneToMany, MetadataAnnotatedElement annotatedElement, ClassAccessor classAccessor)
INTERNAL:
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object objectToCompare)
INTERNAL:protected java.lang.String
getLoggingContext()
INTERNAL: Return the logging context for this accessor.int
hashCode()
boolean
isOneToMany()
INTERNAL:void
process()
INTERNAL: Process a OneToMany accessor into an EclipseLink OneToManyMapping.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.protected void
processManyToManyMapping()
INTERNAL: Process an many to many mapping for this accessor since a join table was specified.protected void
processOneToManyMapping()
INTERNAL: Process an one to many mapping for this accessor.protected void
processUnidirectionalOneToManyMapping()
INTERNAL: Process an unidirectional one to many mapping for this accessor since join columns were specified and no mapped by value.protected void
processUnidirectionalOneToManyTargetForeignKeyRelationship(org.eclipse.persistence.mappings.UnidirectionalOneToManyMapping mapping, java.util.List<JoinColumnMetadata> joinColumns, MetadataDescriptor owningDescriptor)
INTERNAL: Process the join column(s) metadata for the owning side of a unidirectional one to many mapping.-
Methods inherited from class org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.CollectionAccessor
addAssociationOverride, addAttributeOverride, addMapKeyConvert, getColumn, getDefaultFetchType, getDeleteAll, getEnumerated, getMapKey, getMapKeyAssociationOverrides, getMapKeyAttributeOverrides, getMapKeyClass, getMapKeyClassName, getMapKeyClassWithGenerics, getMapKeyColumn, getMapKeyConvert, getMapKeyConverts, getMapKeyEnumerated, getMapKeyForeignKey, getMapKeyJoinColumns, getMapKeyTemporal, getOrderBy, getOrderColumn, getReferenceClass, getReferenceDatabaseTable, getTemporal, hasEnumerated, hasMapKey, hasTemporal, initXMLObject, isCollectionAccessor, isDeleteAll, process, processEISOneToManyMapping, setDeleteAll, setMapKey, setMapKeyAssociationOverrides, setMapKeyAttributeOverrides, setMapKeyClass, setMapKeyClassName, setMapKeyColumn, setMapKeyConverts, setMapKeyEnumerated, setMapKeyForeignKey, setMapKeyJoinColumns, setMapKeyTemporal, setOrderBy, setOrderColumn, setTemporal
-
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, 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, 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
-
OneToManyAccessor
public OneToManyAccessor()
INTERNAL: Used for OX mapping.
-
OneToManyAccessor
public OneToManyAccessor(MetadataAnnotation oneToMany, MetadataAnnotatedElement annotatedElement, ClassAccessor classAccessor)
INTERNAL:
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object objectToCompare)
INTERNAL:- Overrides:
equals
in classCollectionAccessor
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classCollectionAccessor
-
getLoggingContext
protected java.lang.String getLoggingContext()
INTERNAL: Return the logging context for this accessor.- Specified by:
getLoggingContext
in classRelationshipAccessor
-
isOneToMany
public boolean isOneToMany()
INTERNAL:- Overrides:
isOneToMany
in classMappingAccessor
-
process
public void process()
INTERNAL: Process a OneToMany accessor into an EclipseLink OneToManyMapping. If a JoinTable is found however, we must create a ManyToManyMapping.- Overrides:
process
in classCollectionAccessor
-
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:
processAssociationOverride
in classCollectionAccessor
-
processManyToManyMapping
protected void processManyToManyMapping()
INTERNAL: Process an many to many mapping for this accessor since a join table was specified.
-
processOneToManyMapping
protected void processOneToManyMapping()
INTERNAL: Process an one to many mapping for this accessor.
-
processUnidirectionalOneToManyMapping
protected void processUnidirectionalOneToManyMapping()
INTERNAL: Process an unidirectional one to many mapping for this accessor since join columns were specified and no mapped by value.
-
processUnidirectionalOneToManyTargetForeignKeyRelationship
protected void processUnidirectionalOneToManyTargetForeignKeyRelationship(org.eclipse.persistence.mappings.UnidirectionalOneToManyMapping mapping, java.util.List<JoinColumnMetadata> joinColumns, MetadataDescriptor owningDescriptor)
INTERNAL: Process the join column(s) metadata for the owning side of a unidirectional one to many mapping. The default pk 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).
-
-