Package org.eclipse.persistence.mappings
Class DirectCollectionMapping
- java.lang.Object
-
- org.eclipse.persistence.core.mappings.CoreMapping<AttributeAccessor,org.eclipse.persistence.internal.sessions.AbstractSession,org.eclipse.persistence.internal.queries.ContainerPolicy,ClassDescriptor,org.eclipse.persistence.internal.helper.DatabaseField>
-
- org.eclipse.persistence.mappings.DatabaseMapping
-
- org.eclipse.persistence.mappings.ForeignReferenceMapping
-
- org.eclipse.persistence.mappings.CollectionMapping
-
- org.eclipse.persistence.mappings.DirectCollectionMapping
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,ContainerMapping,RelationalMapping
- Direct Known Subclasses:
DirectMapMapping
public class DirectCollectionMapping extends CollectionMapping implements RelationalMapping
Purpose: This mapping is used to store a collection of simple types (String, Number, Date, etc.) into a single table. The table must store the value and a foreign key to the source object. A converter can be used if the desired object type and the data type do not match.
- See Also:
Converter,ObjectTypeConverter,TypeConversionConverter,SerializedObjectConverter, Serialized Form- Author:
- Sati
- Since:
- TOPLink/Java 1.0 09/18/2009-2.0 Michael O'Brien - 266912: JPA 2.0 Metamodel API (part of the JSR-317 EJB 3.1 Criteria API) add support for passing BasicMap value type to MapAttributeImpl via new attributeClassification field
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.persistence.mappings.DatabaseMapping
DatabaseMapping.WriteType
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.ClassattributeClassificationprotected java.lang.StringattributeClassificationNameprotected ModifyQuerychangeSetDeleteNullQueryprotected ModifyQuerychangeSetDeleteQueryUsed for deletion when ChangeSets are usedprotected static java.lang.StringDeleteUsed for data modification events.protected static java.lang.StringDeleteAllprotected static java.lang.StringDeleteAtIndexprotected ModifyQuerydeleteAtIndexQueryUsed (only in case listOrderField !protected org.eclipse.persistence.internal.helper.DatabaseFielddirectFieldThe direct field name is converted and storedprotected booleanhasCustomDeleteAtIndexQueryprotected booleanhasCustomDeleteQueryprotected booleanhasCustomInsertQueryprotected booleanhasCustomUpdateAtIndexQueryprotected HistoryPolicyhistoryPolicyprotected static java.lang.StringInsertprotected DataModifyQueryinsertQueryUsed for insertion for m-m and dc, not used in 1-m.protected java.util.List<Expression>orderByExpressionsprotected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField>referenceKeyFieldsprotected org.eclipse.persistence.internal.helper.DatabaseTablereferenceTableStores the reference tableprotected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField>sourceKeyFieldsprotected static java.lang.StringUpdateAtIndexprotected ModifyQueryupdateAtIndexQueryUsed (only in case listOrderField !protected ConvertervalueConverterAllows user defined conversion between the object value and the database value.protected java.lang.StringvalueConverterClassName-
Fields inherited from class org.eclipse.persistence.mappings.CollectionMapping
changeOrderTargetQuery, containerPolicy, deleteAllQuery, hasCustomDeleteAllQuery, hasOrderBy, isListOrderFieldSupported, isSynchronizeOnMerge, listOrderField, mustDeleteReferenceObjectsOneByOne, orderCorrectionType
-
Fields inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
batchFetchType, cascadeDetach, cascadeMerge, cascadePersist, cascadeRefresh, cascadeRemove, forceInitializationOfSelectionCriteria, hasCustomSelectionQuery, indirectionPolicy, INNER_JOIN, isCascadeOnDeleteSetOnDatabase, isPrivateOwned, joinFetch, mappedBy, NONE, OUTER_JOIN, partitioningPolicy, partitioningPolicyName, QUERY_BATCH_PARAMETER, referenceClass, referenceClassName, referenceDescriptor, relationshipPartner, relationshipPartnerAttributeName, requiresTransientWeavedFields, selectionQuery, tempInitSession
-
Fields inherited from class org.eclipse.persistence.mappings.DatabaseMapping
attributeAccessor, attributeName, derivedIdMapping, derivesId, descriptor, fields, isCacheable, isInSopObject, isJPAId, isLazy, isMapKeyMapping, isOptional, isPrimaryKeyMapping, isReadOnly, isRemotelyInitialized, mapsIdValue, NO_FIELDS, NO_WEIGHT, properties, unconvertedProperties, weight, WEIGHT_AGGREGATE, WEIGHT_DIRECT, WEIGHT_TO_ONE, WEIGHT_TRANSFORM
-
-
Constructor Summary
Constructors Constructor Description DirectCollectionMapping()PUBLIC: Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAscendingOrdering()PUBLIC: Provide ascending order support for this direct collection mapping.voidaddDescendingOrdering()PUBLIC: Provide descending order support for this direct collection mapping.voidaddOrdering(Expression expression)ADVANCED: Used this method to add custom ordering expressions when fetching the collection.voidaddReferenceKeyField(org.eclipse.persistence.internal.helper.DatabaseField referenceForeignKeyField, org.eclipse.persistence.internal.helper.DatabaseField sourcePrimaryKeyField)PUBLIC: Add the reference key field.voidaddReferenceKeyFieldName(java.lang.String referenceForeignKeyFieldName, java.lang.String sourcePrimaryKeyFieldName)PUBLIC: Add the name of the reference key field.protected ExpressionbuildBatchCriteria(ExpressionBuilder builder, ObjectLevelReadQuery query)INTERNAL: Return the selection criteria used to IN batch fetching.voidbuildCopy(java.lang.Object copy, java.lang.Object original, CopyGroup group)INTERNAL: Copy of the attribute of the object.java.lang.ObjectbuildElementClone(java.lang.Object element, java.lang.Object parent, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, java.lang.Integer refreshCascade, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession, boolean isExisting, boolean isFromSharedCache)INTERNAL: Clone the element, if necessary.ExpressionbuildExpression(java.lang.Object queryObject, QueryByExamplePolicy policy, Expression expressionBuilder, java.util.Map processedObjects, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: In case Query By Example is used, this method builds and returns an expression that corresponds to a single attribute and it's value.protected voidbuildListOrderField()INTERNAL: Verifies listOrderField's table: it must be reference table.voidcalculateDeferredChanges(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Used by AttributeLevelChangeTracking to update a changeRecord with calculated changes as apposed to detected changes.voidcascadeDiscoverAndPersistUnregisteredNewObjects(java.lang.Object object, java.util.Map newObjects, java.util.Map unregisteredExistingObjects, java.util.Map visitedObjects, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Set cascadeErrors)INTERNAL: Cascade discover and persist new objects during commit.voidcascadePerformRemoveIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)INTERNAL: Cascade perform delete through mappings that require the cascadevoidcascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)INTERNAL: Cascade perform removal of orphaned private owned objects from the UnitOfWorkChangeSetvoidcascadeRegisterNewIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)INTERNAL: Cascade registerNew for Create through mappings that require the cascadejava.lang.Objectclone()INTERNAL: The mapping clones itself to create deep copy.voidcollectQueryParameters(java.util.Set<org.eclipse.persistence.internal.helper.DatabaseField> cacheFields)INTERNAL: This method is used to store the FK fields that can be cached that correspond to noncacheable mappings the FK field values will be used to re-issue the query when cloning the shared cache entityvoidcompareCollectionsForChange(java.lang.Object oldCollection, java.lang.Object newCollection, org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: This method is used to calculate the differences between two collections.org.eclipse.persistence.internal.sessions.ChangeRecordcompareForChange(java.lang.Object clone, java.lang.Object backUp, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: This method compares the changes between two direct collections.protected booleancompareLists(java.util.List firstList, java.util.List secondList)Compare two lists.voidcompareListsForChange(java.util.List oldList, java.util.List newList, org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: This method is used to calculate the differences between two Lists.booleancompareObjects(java.lang.Object firstObject, java.lang.Object secondObject, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Compare the attributes belonging to this mapping for the objects.voidconvertClassNamesToClasses(java.lang.ClassLoader classLoader)INTERNAL: Convert all the class-name-based settings in this mapping to actual class-based settings This method is implemented by subclasses as necessary.protected ExpressioncreateWhereClauseForDeleteNullQuery(ExpressionBuilder builder)protected ExpressioncreateWhereClauseForDeleteQuery(ExpressionBuilder builder)protected voidexecuteBatchQuery(DatabaseQuery query, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, java.util.Map referenceDataByKey, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)INTERNAL: Prepare and execute the batch query and store the results for each source object in a map keyed by the mappings source keys of the source objects.protected java.lang.ObjectextractBatchKeyFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Extract the primary key value from the source row.protected java.lang.ObjectextractKeyFromTargetRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Extract the source primary key value from the reference direct row.voidfixRealObjectReferences(java.lang.Object object, java.util.Map objectInformation, java.util.Map processedObjects, ObjectLevelReadQuery query, DistributedSession session)INTERNAL: At this point, we realize we don't have indirection; so we need to replace the reference object(s) with the corresponding object(s) from the remote session.protected ExpressiongetAdditionalFieldsBaseExpression(ReadQuery query)INTERNAL: Return the base expression to use for adding fields to the query.java.lang.ClassgetAttributeClassification()PUBLIC: Some databases do not properly support all of the base data types.java.lang.StringgetAttributeClassificationName()INTERNAL: Return the class name of the attribute type.protected ModifyQuerygetDeleteAtIndexQuery()protected ModifyQuerygetDeleteNullQuery()protected ModifyQuerygetDeleteQuery()org.eclipse.persistence.internal.helper.DatabaseFieldgetDirectField()INTERNAL: Return the direct field.java.lang.StringgetDirectFieldName()PUBLIC: Returns the name of the field name in the reference table.java.util.VectorgetFieldsForTranslationInAggregate()INTERNAL: Return source key fields for translation by an AggregateObjectMappingjava.lang.ObjectgetFieldValue(java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Convert the attribute value to a field value.HistoryPolicygetHistoryPolicy()PUBLIC: Allow history support on the reference table.protected DataModifyQuerygetInsertQuery()ExpressiongetJoinCriteria(org.eclipse.persistence.internal.expressions.ObjectExpression context, Expression base)INTERNAL: Returns the join criteria stored in the mapping selection query.java.lang.ObjectgetObjectCorrespondingTo(java.lang.Object object, DistributedSession session, java.util.Map objectDescriptors, java.util.Map processedObjects, ObjectLevelReadQuery query)INTERNAL: return the object on the client corresponding to the specified object.java.lang.ObjectgetObjectValue(java.lang.Object fieldValue, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Convert the field value to an attribute value.java.util.List<Expression>getOrderByExpressions()PUBLIC: Return the order by expression.java.util.List<Expression>getOrderByNormalizedExpressions(Expression base)INTERNAL: Return null if this mapping is used in an order by.java.lang.ClassgetReferenceClass()INTERNAL: This cannot be used with direct collection mappings.java.lang.StringgetReferenceClassName()INTERNAL: Returns the reference class name.ClassDescriptorgetReferenceDescriptor()INTERNAL: There is none on direct collection.java.util.VectorgetReferenceKeyFieldNames()INTERNAL: Return the reference key field names associated with the mapping.java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField>getReferenceKeyFields()INTERNAL: Return the reference key fields.org.eclipse.persistence.internal.helper.DatabaseTablegetReferenceTable()INTERNAL: Return the direct table.java.lang.StringgetReferenceTableName()PUBLIC: Returns the name of the reference tablejava.lang.StringgetReferenceTableQualifiedName()PUBLIC: Returns the qualified name of the reference table.DatabaseMappinggetRelationshipPartner()INTERNAL: Return the relationshipPartner mapping for this bi-directional mapping.java.util.VectorgetSelectFields()INTERNAL: Returns the set of fields that should be selected to build this mapping's value(s).protected org.eclipse.persistence.internal.queries.ContainerPolicygetSelectionQueryContainerPolicy()INTERNAL: Get the container policy from the selection query for this mapping.java.util.VectorgetSelectTables()INTERNAL: Returns the table(s) that should be selected to build this mapping's value(s).java.util.VectorgetSourceKeyFieldNames()PUBLIC: Return the source key field names associated with the mapping.java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField>getSourceKeyFields()INTERNAL: Return the source key fields.protected ModifyQuerygetUpdateAtIndexQuery()ConvertergetValueConverter()PUBLIC: Return the converter on the mapping.protected booleanhasCustomDeleteAtIndexQuery()protected booleanhasCustomDeleteQuery()protected booleanhasCustomInsertQuery()protected booleanhasCustomUpdateAtIndexQuery()booleanhasNestedIdentityReference()INTERNAL: Indicates whether the mapping (or at least one of its nested mappings, at any nested depth) references an entity.voidinitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Initialize and validate the mapping properties.protected voidinitializeDeleteAllQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)Initialize delete all query.protected voidinitializeDeleteAtIndexQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)protected voidinitializeDeleteNullQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)protected voidinitializeDeleteQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)protected voidinitializeDirectField(org.eclipse.persistence.internal.sessions.AbstractSession session)The field name on the reference table is initialized and cached.protected voidinitializeInsertQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)Initialize insert query.protected voidinitializeListOrderField(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Initializes listOrderField.protected voidinitializeReferenceDescriptor(org.eclipse.persistence.internal.sessions.AbstractSession session)There is no reference descriptorprotected voidinitializeReferenceKeys(org.eclipse.persistence.internal.sessions.AbstractSession session)The reference keys on the reference table are initializedprotected voidinitializeReferenceTable(org.eclipse.persistence.internal.sessions.AbstractSession session)Set the table qualifier on the reference table if requiredprotected voidinitializeSelectionCriteria(org.eclipse.persistence.internal.sessions.AbstractSession session)protected voidinitializeSelectionQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)The selection query is initializedprotected voidinitializeSelectionStatement(org.eclipse.persistence.internal.sessions.AbstractSession session)protected voidinitializeSourceKeys(org.eclipse.persistence.internal.sessions.AbstractSession session)The source keys are initializedprotected voidinitializeSourceKeysWithDefaults(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: If a user does not specify the source key then the primary keys of the source table are used.protected voidinitializeUpdateAtIndexQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)protected voidinitOrRebuildSelectQuery()INTERNAL: Used by DirectMapMapping to rebuild select query.booleanisCandidateForPrivateOwnedRemoval()INTERNAL: DirectCollectionMapping contents should not be considered for addition to the UnitOfWork private owned objects list for removal.booleanisCascadedLockingSupported()INTERNAL Return true if this mapping supports cascaded version optimistic locking.booleanisDirectCollectionMapping()INTERNAL:booleanisElementCollectionMapping()INTERNAL:booleanisJoiningSupported()INTERNAL: Return if this mapping support joining.protected booleanisKeyForSourceSpecified()INTERNAL: Checks if source and target keys are mentioned by the user or not.booleanisLockableMapping()INTERNAL: Return whether this mapping should be traversed when we are lockingbooleanisOwned()INTERNAL:booleanisRelationalMapping()INTERNAL: All relational mappings should implement this method to return true.voiditerateOnElement(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator, java.lang.Object element)INTERNAL: Iterate on the specified element.voiditerateOnRealAttributeValue(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator, java.lang.Object realAttributeValue)INTERNAL: Iterate on the attribute value.protected voidmergeAddRemoveChanges(java.lang.Object valueOfTarget, java.lang.Object delegateTarget, org.eclipse.persistence.internal.sessions.DirectCollectionChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Merge changes by adding and removing from the change record to the target object, and its delegate object if instance of IndirectCollection.voidmergeChangesIntoObject(java.lang.Object target, org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, java.lang.Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)INTERNAL: Merge changes from the source to the target object.voidmergeIntoObject(java.lang.Object target, boolean isTargetUnInitialized, java.lang.Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)INTERNAL: Merge changes from the source to the target object.voidperformDataModificationEvent(java.lang.Object[] event, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Perform the commit event.voidpostCalculateChanges(ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.voidpostInsert(WriteObjectQuery query)INTERNAL: Insert the private owned object.voidpostUpdate(WriteObjectQuery writeQuery)INTERNAL: Update private owned part.protected voidpostUpdateWithChangeSet(WriteObjectQuery writeQuery)INTERNAL: Update private owned part.protected voidpostUpdateWithChangeSetListOrder(WriteObjectQuery writeQuery)INTERNAL: Update private owned part.voidpreDelete(DeleteObjectQuery query)INTERNAL: Delete private owned part.ReadQueryprepareNestedBatchQuery(ObjectLevelReadQuery query)INTERNAL: Clone and prepare the selection query as a nested batch read query.ObjectLevelReadQueryprepareNestedJoins(org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery baseQuery, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Clone and prepare the joined direct query.protected voidprepareTranslationRow(org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, java.lang.Object object, ClassDescriptor descriptor, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: The translation row may require additional fields than the primary key if the mapping in not on the primary key.voidrecordPrivateOwnedRemovals(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.voidremoteInitialization(DistributedSession session)INTERNAL: Once descriptors are serialized to the remote session.java.util.MapreplaceValueHoldersIn(java.lang.Object object, org.eclipse.persistence.internal.sessions.remote.RemoteSessionController controller)INTERNAL: replace the value holders in the specified reference object(s)voidsetAttributeClassification(java.lang.Class attributeClassification)PUBLIC: Some databases do not properly support all of the base data types.voidsetAttributeClassificationName(java.lang.String attributeClassificationName)INTERNAL: Set the name of the class for MW usage.voidsetContainerPolicy(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)ADVANCED: Configure the mapping to use a container policy.voidsetCustomDeleteAtIndexQuery(ModifyQuery query)PUBLIC: The default delete by index query for this mapping can be overridden by specifying the new query.voidsetCustomDeleteQuery(ModifyQuery query)PUBLIC: The default delete query for this mapping can be overridden by specifying the new query.voidsetCustomInsertQuery(DataModifyQuery query)PUBLIC: The default insert query for mapping can be overridden by specifying the new query.voidsetCustomUpdateAtIndexQuery(ModifyQuery query)PUBLIC: The default delete by index query for this mapping can be overridden by specifying the new query.protected voidsetDeleteQuery(ModifyQuery query)voidsetDeleteSQLString(java.lang.String sqlString)PUBLIC: Set the receiver's delete SQL string.voidsetDirectField(org.eclipse.persistence.internal.helper.DatabaseField field)PUBLIC: Set the direct field in the reference table.voidsetDirectFieldClassification(java.lang.Class fieldType)ADVANCED: Set the class type of the field value.voidsetDirectFieldClassificationName(java.lang.String className)ADVANCED: Set the class type of the field value.voidsetDirectFieldName(java.lang.String fieldName)PUBLIC: Set the direct field name in the reference table.protected voidsetHasCustomDeleteQuery(boolean bool)protected voidsetHasCustomInsertQuery(boolean bool)voidsetHistoryPolicy(HistoryPolicy policy)PUBLIC: Support history on the reference table.protected voidsetInsertQuery(DataModifyQuery insertQuery)voidsetInsertSQLString(java.lang.String sqlString)PUBLIC: Set the receiver's insert SQL string.voidsetReferenceClass(java.lang.Class referenceClass)INTERNAL: This cannot be used with direct collection mappings.voidsetReferenceClassName(java.lang.String referenceClassName)INTERNAL: Used by MW.voidsetReferenceKeyFieldName(java.lang.String fieldName)PUBLIC: Set the name of the reference key field.voidsetReferenceKeyFieldNames(java.util.Vector fieldNames)INTERNAL: Set the reference key field names associated with the mapping.voidsetReferenceKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> aVector)INTERNAL: Set the reference fields.voidsetReferenceTable(org.eclipse.persistence.internal.helper.DatabaseTable table)INTERNAL: Set the reference table.voidsetReferenceTableName(java.lang.String tableName)PUBLIC: Set the reference table name.voidsetSelectionCriteria(Expression anExpression)PUBLIC: Sets the selection criteria to be used as a where clause to read reference objects.protected voidsetSelectionQueryContainerPolicy(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)INTERNAL: Set the container policy on the selection query for this mapping.voidsetSessionName(java.lang.String name)PUBLIC: Set the name of the session to execute the mapping's queries under.voidsetSourceKeyFieldNames(java.util.Vector fieldNames)INTERNAL: Set the source key field names associated with the mapping.voidsetSourceKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceKeyFields)INTERNAL: Set the source fields.voidsetValueConverter(Converter valueConverter)PUBLIC: Set the converter on the mapping.voidsetValueConverterClassName(java.lang.String valueConverterClassName)PUBLIC: Set the converter class name on the mapping.booleanshouldUseListOrderFieldTableExpression()INTERNAL: Indicates whether getListOrderFieldExpression method should create field expression on table expression.protected voidsimpleAddToCollectionChangeRecord(java.lang.Object objectToAdd, java.lang.Integer index, boolean isSet, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean isChangeApplied)voidsimpleAddToCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object objectToAdd, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.internal.sessions.AbstractSession session)ADVANCED: This method is used to have an object add to a collection once the changeSet is applied The referenceKey parameter should only be used for direct Maps.protected voidsimpleRemoveFromCollectionChangeRecord(java.lang.Object objectToRemove, java.lang.Integer index, boolean isSet, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean isChangeApplied)voidsimpleRemoveFromCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object objectToRemove, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.internal.sessions.AbstractSession session)ADVANCED: This method is used to have an object removed from a collection once the changeSet is applied The referenceKey parameter should only be used for direct Maps.voidupdateChangeRecord(java.lang.Object clone, java.lang.Object newValue, java.lang.Object oldValue, org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)INTERNAL: Either create a new change record or update with the new value.voidupdateCollectionChangeRecord(CollectionChangeEvent event, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)INTERNAL: Add or removes a new value and its change set to the collection change record based on the event passed in.voiduseMapClass(java.lang.Class concreteClass, java.lang.String methodName)PUBLIC: It is illegal to use a Map as the container of a DirectCollectionMapping.java.lang.ObjectvalueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean isTargetProtected, java.lang.Boolean[] wasCacheUsed)INTERNAL: Return the value of the reference attribute or a value holder.protected java.lang.ObjectvalueFromRowInternalWithJoin(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, org.eclipse.persistence.internal.sessions.AbstractSession executionSession, boolean isTargetProtected)INTERNAL: Return the value of the field from the row or a value holder on the query to obtain the object.booleanverifyDelete(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Checks if object is deleted from the database or not.-
Methods inherited from class org.eclipse.persistence.mappings.CollectionMapping
addAggregateOrderBy, addAscendingOrdering, addDescendingOrdering, addOrderBy, buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildContainerClone, buildElementUnitOfWorkClone, buildReferencesPKList, compareLists, compareListsAndWrite, compareObjectsAndWrite, compareObjectsWithoutPrivateOwned, compareObjectsWithPrivateOwned, copyElement, extractResultFromBatchQuery, getContainerPolicy, getDeleteAllQuery, getListOrderField, getOrderByQueryKeyExpressions, getOrderCorrectionType, getRealCollectionAttributeValueFromObject, getTargetPrimaryKeyFields, hasCustomDeleteAllQuery, hasOrderBy, initializeChangeOrderTargetQuery, initializeListOrderFieldTable, isAttributeValueInstantiatedOrChanged, isChangeTrackingSupported, isCollectionMapping, isListOrderFieldSupported, isMapKeyObjectRelationship, load, loadAll, mustDeleteReferenceObjectsOneByOne, objectAddedDuringUpdate, objectOrderChangedDuringUpdate, objectRemovedDuringUpdate, objectUnchangedDuringUpdate, objectUnchangedDuringUpdate, postDelete, postInitialize, postPrepareNestedBatchQuery, preInsert, preUpdate, readPrivateOwnedForObject, setChangeListener, setCustomDeleteAllQuery, setDeleteAllCall, setDeleteAllQuery, setDeleteAllSQLString, setHasCustomDeleteAllQuery, setListOrderField, setListOrderFieldName, setMustDeleteReferenceObjectsOneByOne, setOrderCorrectionType, setUseLazyInstantiationForIndirectCollection, shouldUseLazyInstantiationForIndirectCollection, updateChangeRecordForSelfMerge, useCollectionClass, useCollectionClassName, useListClassName, useMapClass, useMapClassName, useSortedSetClass, useSortedSetClassName, useSortedSetClassName, useTransparentCollection, useTransparentList, useTransparentMap, useTransparentSet, validateBeforeInitialization, valueFromPKList, writeChanges
-
Methods inherited from class org.eclipse.persistence.mappings.ForeignReferenceMapping
addForeignKeyField, addTargetForeignKeyField, batchedValueFromRow, buildBackupClone, buildClone, buildCloneFromRow, checkCacheForBatchKey, createCloneValueHolder, dontDoMerge, dontUseBatchReading, dontUseIndirection, extendPessimisticLockScopeInSourceQuery, extendPessimisticLockScopeInTargetQuery, fixObjectReferences, getAttributeValueFromObject, getAttributeValueWithClonedValueHolders, getBatchFetchType, getExtendPessimisticLockScopeDedicatedQuery, getIndirectionPolicy, getJoinFetch, getMappedBy, getPartitioningPolicy, getPartitioningPolicyName, getRealAttributeValueFromAttribute, getRelationshipPartnerAttributeName, getSelectionCriteria, getSelectionQuery, getTempSession, getValueFromRemoteValueHolder, hasCustomSelectionQuery, hasDependency, instantiateAttribute, isAttributeValueFromObjectInstantiated, isAttributeValueFullyBuilt, isAttributeValueInstantiated, isCascadeDetach, isCascadeMerge, isCascadeOnDeleteSetOnDatabase, isCascadePersist, isCascadeRefresh, isCascadeRemove, isExtendingPessimisticLockScope, isForeignReferenceMapping, isInnerJoinFetched, isJoinFetched, isLazy, isOuterJoinFetched, isPrivateOwned, iterate, mergeRemoteValueHolder, preInitialize, prepareHistoricalQuery, prepareNestedJoinQueryClone, privateOwnedRelationship, readFromRowIntoObject, requiresTransientWeavedFields, setBatchFetchType, setCascadeAll, setCascadeDetach, setCascadeMerge, setCascadePersist, setCascadeRefresh, setCascadeRemove, setCustomSelectionQuery, setForceInitializationOfSelectionCriteria, setHasCustomSelectionQuery, setIndirectionPolicy, setIsCacheable, setIsCascadeOnDeleteSetOnDatabase, setIsPrivateOwned, setJoinFetch, setMappedBy, setPartitioningPolicy, setPartitioningPolicyName, setRealAttributeValueInObject, setReferenceDescriptor, setRelationshipPartner, setRelationshipPartnerAttributeName, setRequiresTransientWeavedFields, setSelectionCall, setSelectionQuery, setSelectionSQLString, setShouldExtendPessimisticLockScope, setTempSession, setUsesBatchReading, setUsesIndirection, shouldExtendPessimisticLockScope, shouldExtendPessimisticLockScopeInDedicatedQuery, shouldExtendPessimisticLockScopeInSourceQuery, shouldExtendPessimisticLockScopeInTargetQuery, shouldForceInitializationOfSelectionCriteria, shouldInitializeSelectionCriteria, shouldMergeCascadeParts, shouldMergeCascadeReference, shouldObjectModifyCascadeToParts, shouldRefreshCascadeParts, shouldUseBatchReading, shouldUseValueFromRowWithJoin, trimRowForJoin, trimRowForJoin, useBasicIndirection, useBatchReading, useContainerIndirection, useInnerJoinFetch, useOuterJoinFetch, usesIndirection, useWeavedIndirection, valueFromRowInternal, valueFromRowInternal
-
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
addUnconvertedProperty, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, cloneFields, collectFields, convertConverterClassNamesToClasses, derivesId, earlyPreDelete, extractNestedExpressions, extractNestedNonAggregateExpressions, getAttributeAccessor, getAttributeName, getDerivedIdMapping, getDescriptor, getField, getFieldClassification, getFields, getGetMethodName, getMapsIdValue, getProperties, getProperty, getRealAttributeValueFromObject, getSetMethodName, getUnconvertedProperties, getWeight, hasConstraintDependency, hasInverseConstraintDependency, hasMapsIdValue, hasRootExpressionThatShouldUseOuterJoin, hasUnconvertedProperties, isAbstractColumnMapping, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCacheable, isCloningRequired, isDatabaseMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isInAndOutSopObject, isInOnlySopObject, isInSopObject, isJPAId, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isMultitenantPrimaryKeyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isOutOnlySopObject, isOutSopObject, isPrimaryKeyMapping, isReadOnly, isReferenceMapping, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, isWriteOnly, isXMLMapping, postCalculateChangesOnDeleted, postInitializeSourceAndTargetExpressions, prepareCascadeLockingPolicy, readFromResultSetIntoObject, readOnly, readWrite, rehashFieldDependancies, remotelyInitialized, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setDerivedIdMapping, setDerivesId, setDescriptor, setFields, setGetMethodName, setIsInAndOutSopObject, setIsInSopObject, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsOutSopObject, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setSetMethodName, setWeight, toString, validateAfterInitialization, valueFromObject, valueFromResultSet, valueFromRow, writeFromAttributeIntoRow, writeFromObjectIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowForUpdateAfterShallowInsert, writeFromObjectIntoRowForUpdateBeforeShallowDelete, writeFromObjectIntoRowForWhereClause, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow, writeUpdateFieldsIntoRow
-
-
-
-
Field Detail
-
Delete
protected static final java.lang.String Delete
Used for data modification events.- See Also:
- Constant Field Values
-
Insert
protected static final java.lang.String Insert
- See Also:
- Constant Field Values
-
DeleteAll
protected static final java.lang.String DeleteAll
- See Also:
- Constant Field Values
-
DeleteAtIndex
protected static final java.lang.String DeleteAtIndex
- See Also:
- Constant Field Values
-
UpdateAtIndex
protected static final java.lang.String UpdateAtIndex
- See Also:
- Constant Field Values
-
valueConverter
protected Converter valueConverter
Allows user defined conversion between the object value and the database value.
-
valueConverterClassName
protected java.lang.String valueConverterClassName
-
orderByExpressions
protected java.util.List<Expression> orderByExpressions
-
referenceTable
protected org.eclipse.persistence.internal.helper.DatabaseTable referenceTable
Stores the reference table
-
directField
protected org.eclipse.persistence.internal.helper.DatabaseField directField
The direct field name is converted and stored
-
sourceKeyFields
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceKeyFields
-
referenceKeyFields
protected java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> referenceKeyFields
-
insertQuery
protected DataModifyQuery insertQuery
Used for insertion for m-m and dc, not used in 1-m.
-
changeSetDeleteQuery
protected ModifyQuery changeSetDeleteQuery
Used for deletion when ChangeSets are used
-
changeSetDeleteNullQuery
protected transient ModifyQuery changeSetDeleteNullQuery
-
hasCustomDeleteQuery
protected boolean hasCustomDeleteQuery
-
hasCustomInsertQuery
protected boolean hasCustomInsertQuery
-
historyPolicy
protected HistoryPolicy historyPolicy
-
deleteAtIndexQuery
protected ModifyQuery deleteAtIndexQuery
Used (only in case listOrderField != null) to delete object with particular orderFieldValue
-
updateAtIndexQuery
protected ModifyQuery updateAtIndexQuery
Used (only in case listOrderField != null) to update orderFieldValue of object with particular orderFieldValue
-
hasCustomDeleteAtIndexQuery
protected boolean hasCustomDeleteAtIndexQuery
-
hasCustomUpdateAtIndexQuery
protected boolean hasCustomUpdateAtIndexQuery
-
attributeClassification
protected transient java.lang.Class attributeClassification
- Since:
- Java Persistence API 2.0 Referenced by MapAttributeImpl to pick up the BasicMap value parameter type To specify the conversion type
-
attributeClassificationName
protected java.lang.String attributeClassificationName
-
-
Method Detail
-
addAscendingOrdering
public void addAscendingOrdering()
PUBLIC: Provide ascending order support for this direct collection mapping.
-
addDescendingOrdering
public void addDescendingOrdering()
PUBLIC: Provide descending order support for this direct collection mapping.
-
addOrdering
public void addOrdering(Expression expression)
ADVANCED: Used this method to add custom ordering expressions when fetching the collection. This could be things like expressions using a functions like UPPER or NULLS LAST etc.
-
isRelationalMapping
public boolean isRelationalMapping()
Description copied from class:DatabaseMappingINTERNAL: All relational mappings should implement this method to return true.- Overrides:
isRelationalMappingin classDatabaseMapping
-
getValueConverter
public Converter getValueConverter()
PUBLIC: Return the converter on the mapping. A converter can be used to convert between the direct collection's object value and database value.
-
setValueConverter
public void setValueConverter(Converter valueConverter)
PUBLIC: Set the converter on the mapping. A converter can be used to convert between the direct collection's object value and database value.
-
setValueConverterClassName
public void setValueConverterClassName(java.lang.String valueConverterClassName)
PUBLIC: Set the converter class name on the mapping. Initialized in convertClassNamesToClasses. A converter can be used to convert between the direct collection's object value and database value.
-
addReferenceKeyField
public void addReferenceKeyField(org.eclipse.persistence.internal.helper.DatabaseField referenceForeignKeyField, org.eclipse.persistence.internal.helper.DatabaseField sourcePrimaryKeyField)PUBLIC: Add the reference key field. This is used for composite reference keys. This is the foreign key field in the direct table referencing the primary key of the source object. Both the reference field and the source field that it references must be provided.
-
addReferenceKeyFieldName
public void addReferenceKeyFieldName(java.lang.String referenceForeignKeyFieldName, java.lang.String sourcePrimaryKeyFieldName)PUBLIC: Add the name of the reference key field. This is used for composite reference keys. This is the foreign key field in the direct table referencing the primary key of the source object. Both the reference field name and the name of the source field that it references must be provided.
-
prepareNestedBatchQuery
public ReadQuery prepareNestedBatchQuery(ObjectLevelReadQuery query)
INTERNAL: Clone and prepare the selection query as a nested batch read query. This is used for nested batch reading.- Overrides:
prepareNestedBatchQueryin classForeignReferenceMapping
-
prepareNestedJoins
public ObjectLevelReadQuery prepareNestedJoins(org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery baseQuery, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Clone and prepare the joined direct query. Since direct-collection does not build objects a nest query is not required.- Overrides:
prepareNestedJoinsin classForeignReferenceMapping
-
valueFromRowInternalWithJoin
protected java.lang.Object valueFromRowInternalWithJoin(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, org.eclipse.persistence.internal.sessions.AbstractSession executionSession, boolean isTargetProtected) throws DatabaseExceptionINTERNAL: Return the value of the field from the row or a value holder on the query to obtain the object.- Overrides:
valueFromRowInternalWithJoinin classCollectionMapping- Throws:
DatabaseException
-
buildCopy
public void buildCopy(java.lang.Object copy, java.lang.Object original, CopyGroup group)INTERNAL: Copy of the attribute of the object. This is NOT used for unit of work but for templatizing an object.- Overrides:
buildCopyin classCollectionMapping
-
buildElementClone
public java.lang.Object buildElementClone(java.lang.Object element, java.lang.Object parent, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, java.lang.Integer refreshCascade, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession, boolean isExisting, boolean isFromSharedCache)INTERNAL: Clone the element, if necessary. DirectCollections hold on to objects that do not have Descriptors (e.g. int, String). These objects do not need to be cloned, unless they use a converter - they are immutable.- Overrides:
buildElementClonein classCollectionMapping
-
buildExpression
public Expression buildExpression(java.lang.Object queryObject, QueryByExamplePolicy policy, Expression expressionBuilder, java.util.Map processedObjects, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: In case Query By Example is used, this method builds and returns an expression that corresponds to a single attribute and it's value.- Overrides:
buildExpressionin classCollectionMapping
-
buildListOrderField
protected void buildListOrderField()
INTERNAL: Verifies listOrderField's table: it must be reference table. Precondition: listOrderField != null.- Overrides:
buildListOrderFieldin classCollectionMapping
-
cascadePerformRemoveIfRequired
public void cascadePerformRemoveIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)INTERNAL: Cascade perform delete through mappings that require the cascade- Overrides:
cascadePerformRemoveIfRequiredin classCollectionMapping
-
cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired
public void cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)INTERNAL: Cascade perform removal of orphaned private owned objects from the UnitOfWorkChangeSet- Overrides:
cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequiredin classCollectionMapping
-
cascadeRegisterNewIfRequired
public void cascadeRegisterNewIfRequired(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Map visitedObjects)INTERNAL: Cascade registerNew for Create through mappings that require the cascade- Overrides:
cascadeRegisterNewIfRequiredin classCollectionMapping
-
cascadeDiscoverAndPersistUnregisteredNewObjects
public void cascadeDiscoverAndPersistUnregisteredNewObjects(java.lang.Object object, java.util.Map newObjects, java.util.Map unregisteredExistingObjects, java.util.Map visitedObjects, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow, java.util.Set cascadeErrors)INTERNAL: Cascade discover and persist new objects during commit.- Overrides:
cascadeDiscoverAndPersistUnregisteredNewObjectsin classCollectionMapping
-
clone
public java.lang.Object clone()
INTERNAL: The mapping clones itself to create deep copy.- Overrides:
clonein classCollectionMapping
-
compareCollectionsForChange
public void compareCollectionsForChange(java.lang.Object oldCollection, java.lang.Object newCollection, org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: This method is used to calculate the differences between two collections.- Overrides:
compareCollectionsForChangein classCollectionMapping
-
compareListsForChange
public void compareListsForChange(java.util.List oldList, java.util.List newList, org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: This method is used to calculate the differences between two Lists.
-
compareForChange
public org.eclipse.persistence.internal.sessions.ChangeRecord compareForChange(java.lang.Object clone, java.lang.Object backUp, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: This method compares the changes between two direct collections. Comparisons are made on equality not identity.- Overrides:
compareForChangein classCollectionMapping- Returns:
- prototype.changeset.ChangeRecord
-
compareObjects
public boolean compareObjects(java.lang.Object firstObject, java.lang.Object secondObject, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Compare the attributes belonging to this mapping for the objects.- Overrides:
compareObjectsin classCollectionMapping
-
compareLists
protected boolean compareLists(java.util.List firstList, java.util.List secondList)Compare two lists. For equality the order of the elements should be the same. Used only if listOrderField != null
-
convertClassNamesToClasses
public void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this mapping to actual class-based settings This method is implemented by subclasses as necessary.- Overrides:
convertClassNamesToClassesin classCollectionMapping- Parameters:
classLoader-
-
extractKeyFromTargetRow
protected java.lang.Object extractKeyFromTargetRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Extract the source primary key value from the reference direct row. Used for batch reading, most following same order and fields as in the mapping.- Overrides:
extractKeyFromTargetRowin classCollectionMapping
-
extractBatchKeyFromRow
protected java.lang.Object extractBatchKeyFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Extract the primary key value from the source row. Used for batch reading, most following same order and fields as in the mapping.- Overrides:
extractBatchKeyFromRowin classForeignReferenceMapping
-
buildBatchCriteria
protected Expression buildBatchCriteria(ExpressionBuilder builder, ObjectLevelReadQuery query)
INTERNAL: Return the selection criteria used to IN batch fetching.- Overrides:
buildBatchCriteriain classForeignReferenceMapping
-
executeBatchQuery
protected void executeBatchQuery(DatabaseQuery query, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, java.util.Map referenceDataByKey, org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)
INTERNAL: Prepare and execute the batch query and store the results for each source object in a map keyed by the mappings source keys of the source objects.- Overrides:
executeBatchQueryin classCollectionMapping
-
fixRealObjectReferences
public void fixRealObjectReferences(java.lang.Object object, java.util.Map objectInformation, java.util.Map processedObjects, ObjectLevelReadQuery query, DistributedSession session)INTERNAL: At this point, we realize we don't have indirection; so we need to replace the reference object(s) with the corresponding object(s) from the remote session. The reference objects for a DirectCollectionMapping are primitives, so they do not need to be replaced.- Overrides:
fixRealObjectReferencesin classCollectionMapping
-
getAttributeClassification
public java.lang.Class getAttributeClassification()
PUBLIC: Some databases do not properly support all of the base data types. For these databases, the base data type must be explicitly specified in the mapping to tell EclipseLink to force the instance variable value to that data type.- Overrides:
getAttributeClassificationin classDatabaseMapping- Since:
- Java Persistence API 2.0
-
getAttributeClassificationName
public java.lang.String getAttributeClassificationName()
INTERNAL: Return the class name of the attribute type. This is only used by the MW.- Since:
- Java Persistence API 2.0
-
getDeleteQuery
protected ModifyQuery getDeleteQuery()
-
getDeleteNullQuery
protected ModifyQuery getDeleteNullQuery()
-
getDeleteAtIndexQuery
protected ModifyQuery getDeleteAtIndexQuery()
-
getUpdateAtIndexQuery
protected ModifyQuery getUpdateAtIndexQuery()
-
getSelectFields
public java.util.Vector getSelectFields()
INTERNAL: Returns the set of fields that should be selected to build this mapping's value(s). This is used by expressions to determine which fields to include in the select clause for non-object expressions.- Overrides:
getSelectFieldsin classDatabaseMapping
-
getSelectTables
public java.util.Vector getSelectTables()
INTERNAL: Returns the table(s) that should be selected to build this mapping's value(s). This is used by expressions to determine which tables to include in the from clause for non-object expressions.- Overrides:
getSelectTablesin classDatabaseMapping
-
getDirectField
public org.eclipse.persistence.internal.helper.DatabaseField getDirectField()
INTERNAL: Return the direct field. This is the field in the direct table to store the values.
-
getDirectFieldName
public java.lang.String getDirectFieldName()
PUBLIC: Returns the name of the field name in the reference table.
-
getInsertQuery
protected DataModifyQuery getInsertQuery()
-
getJoinCriteria
public Expression getJoinCriteria(org.eclipse.persistence.internal.expressions.ObjectExpression context, Expression base)
INTERNAL: Returns the join criteria stored in the mapping selection query. This criteria is used to read reference objects across the tables from the database.- Overrides:
getJoinCriteriain classCollectionMapping
-
getObjectCorrespondingTo
public java.lang.Object getObjectCorrespondingTo(java.lang.Object object, DistributedSession session, java.util.Map objectDescriptors, java.util.Map processedObjects, ObjectLevelReadQuery query)INTERNAL: return the object on the client corresponding to the specified object. DirectCollections do not have to worry about maintaining object identity.- Overrides:
getObjectCorrespondingToin classCollectionMapping
-
getOrderByExpressions
public java.util.List<Expression> getOrderByExpressions()
PUBLIC: Return the order by expression.
-
getOrderByNormalizedExpressions
public java.util.List<Expression> getOrderByNormalizedExpressions(Expression base)
INTERNAL: Return null if this mapping is used in an order by.- Overrides:
getOrderByNormalizedExpressionsin classForeignReferenceMapping
-
getHistoryPolicy
public HistoryPolicy getHistoryPolicy()
PUBLIC: Allow history support on the reference table.
-
getSelectionQueryContainerPolicy
protected org.eclipse.persistence.internal.queries.ContainerPolicy getSelectionQueryContainerPolicy()
INTERNAL: Get the container policy from the selection query for this mapping.- Overrides:
getSelectionQueryContainerPolicyin classCollectionMapping
-
getReferenceClass
public java.lang.Class getReferenceClass()
INTERNAL: This cannot be used with direct collection mappings.- Overrides:
getReferenceClassin classForeignReferenceMapping
-
getReferenceClassName
public java.lang.String getReferenceClassName()
Description copied from class:ForeignReferenceMappingINTERNAL: Returns the reference class name.- Overrides:
getReferenceClassNamein classForeignReferenceMapping
-
getReferenceDescriptor
public ClassDescriptor getReferenceDescriptor()
INTERNAL: There is none on direct collection.- Overrides:
getReferenceDescriptorin classForeignReferenceMapping
-
getReferenceKeyFieldNames
public java.util.Vector getReferenceKeyFieldNames()
INTERNAL: Return the reference key field names associated with the mapping. These are in-order with the sourceKeyFieldNames.
-
getReferenceKeyFields
public java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> getReferenceKeyFields()
INTERNAL: Return the reference key fields.
-
getReferenceTable
public org.eclipse.persistence.internal.helper.DatabaseTable getReferenceTable()
INTERNAL: Return the direct table. This is the table to store the values.
-
getReferenceTableName
public java.lang.String getReferenceTableName()
PUBLIC: Returns the name of the reference table
-
getReferenceTableQualifiedName
public java.lang.String getReferenceTableQualifiedName()
PUBLIC: Returns the qualified name of the reference table.
-
getRelationshipPartner
public DatabaseMapping getRelationshipPartner()
INTERNAL: Return the relationshipPartner mapping for this bi-directional mapping. If the relationshipPartner is null then this is a uni-directional mapping. DirectCollectionMapping can not be part of a bi-directional mapping- Overrides:
getRelationshipPartnerin classForeignReferenceMapping
-
getSourceKeyFieldNames
public java.util.Vector getSourceKeyFieldNames()
PUBLIC: Return the source key field names associated with the mapping. These are in-order with the referenceKeyFieldNames.
-
getSourceKeyFields
public java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> getSourceKeyFields()
INTERNAL: Return the source key fields.
-
hasCustomDeleteQuery
protected boolean hasCustomDeleteQuery()
-
hasCustomInsertQuery
protected boolean hasCustomInsertQuery()
-
hasCustomDeleteAtIndexQuery
protected boolean hasCustomDeleteAtIndexQuery()
-
hasCustomUpdateAtIndexQuery
protected boolean hasCustomUpdateAtIndexQuery()
-
hasNestedIdentityReference
public boolean hasNestedIdentityReference()
INTERNAL: Indicates whether the mapping (or at least one of its nested mappings, at any nested depth) references an entity. To return true the mapping (or nested mapping) should be ForeignReferenceMapping with non-null and non-aggregate reference descriptor.- Overrides:
hasNestedIdentityReferencein classForeignReferenceMapping
-
initialize
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorExceptionINTERNAL: Initialize and validate the mapping properties.- Overrides:
initializein classCollectionMapping- Throws:
DescriptorException
-
initializeListOrderField
protected void initializeListOrderField(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Initializes listOrderField. Precondition: listOrderField != null.- Overrides:
initializeListOrderFieldin classCollectionMapping
-
initializeDeleteAllQuery
protected void initializeDeleteAllQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
Initialize delete all query. This query is used to delete the collection of objects from the reference table.
-
initializeDeleteQuery
protected void initializeDeleteQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
-
initializeDeleteNullQuery
protected void initializeDeleteNullQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
-
initializeDeleteAtIndexQuery
protected void initializeDeleteAtIndexQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
-
initializeUpdateAtIndexQuery
protected void initializeUpdateAtIndexQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
-
shouldUseListOrderFieldTableExpression
public boolean shouldUseListOrderFieldTableExpression()
INTERNAL: Indicates whether getListOrderFieldExpression method should create field expression on table expression.- Overrides:
shouldUseListOrderFieldTableExpressionin classCollectionMapping
-
createWhereClauseForDeleteQuery
protected Expression createWhereClauseForDeleteQuery(ExpressionBuilder builder)
-
createWhereClauseForDeleteNullQuery
protected Expression createWhereClauseForDeleteNullQuery(ExpressionBuilder builder)
-
initializeDirectField
protected void initializeDirectField(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorExceptionThe field name on the reference table is initialized and cached.- Throws:
DescriptorException
-
initializeInsertQuery
protected void initializeInsertQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
Initialize insert query. This query is used to insert the collection of objects into the reference table.
-
initializeReferenceDescriptor
protected void initializeReferenceDescriptor(org.eclipse.persistence.internal.sessions.AbstractSession session)
There is no reference descriptor- Overrides:
initializeReferenceDescriptorin classForeignReferenceMapping
-
initializeReferenceKeys
protected void initializeReferenceKeys(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorExceptionThe reference keys on the reference table are initialized- Throws:
DescriptorException
-
initializeReferenceTable
protected void initializeReferenceTable(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorExceptionSet the table qualifier on the reference table if required- Throws:
DescriptorException
-
initializeSelectionCriteria
protected void initializeSelectionCriteria(org.eclipse.persistence.internal.sessions.AbstractSession session)
-
initializeSelectionQuery
protected void initializeSelectionQuery(org.eclipse.persistence.internal.sessions.AbstractSession session)
The selection query is initialized- Overrides:
initializeSelectionQueryin classForeignReferenceMapping
-
initializeSelectionStatement
protected void initializeSelectionStatement(org.eclipse.persistence.internal.sessions.AbstractSession session)
-
initializeSourceKeys
protected void initializeSourceKeys(org.eclipse.persistence.internal.sessions.AbstractSession session)
The source keys are initialized
-
initializeSourceKeysWithDefaults
protected void initializeSourceKeysWithDefaults(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: If a user does not specify the source key then the primary keys of the source table are used.
-
getAdditionalFieldsBaseExpression
protected Expression getAdditionalFieldsBaseExpression(ReadQuery query)
INTERNAL: Return the base expression to use for adding fields to the query. This is the reference table.- Overrides:
getAdditionalFieldsBaseExpressionin classCollectionMapping
-
isDirectCollectionMapping
public boolean isDirectCollectionMapping()
INTERNAL:- Overrides:
isDirectCollectionMappingin classDatabaseMapping
-
isElementCollectionMapping
public boolean isElementCollectionMapping()
INTERNAL:- Overrides:
isElementCollectionMappingin classDatabaseMapping
-
isJoiningSupported
public boolean isJoiningSupported()
INTERNAL: Return if this mapping support joining.- Overrides:
isJoiningSupportedin classForeignReferenceMapping
-
isKeyForSourceSpecified
protected boolean isKeyForSourceSpecified()
INTERNAL: Checks if source and target keys are mentioned by the user or not.
-
isLockableMapping
public boolean isLockableMapping()
INTERNAL: Return whether this mapping should be traversed when we are locking- Overrides:
isLockableMappingin classForeignReferenceMapping- Returns:
-
isOwned
public boolean isOwned()
INTERNAL:- Overrides:
isOwnedin classDatabaseMapping
-
iterateOnRealAttributeValue
public void iterateOnRealAttributeValue(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator, java.lang.Object realAttributeValue)INTERNAL: Iterate on the attribute value. The value holder has already been processed. PERF: Avoid iteration if not required.- Overrides:
iterateOnRealAttributeValuein classCollectionMapping
-
iterateOnElement
public void iterateOnElement(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator, java.lang.Object element)INTERNAL: Iterate on the specified element.- Overrides:
iterateOnElementin classCollectionMapping
-
mergeChangesIntoObject
public void mergeChangesIntoObject(java.lang.Object target, org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, java.lang.Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)INTERNAL: Merge changes from the source to the target object. Because this is a collection mapping, values are added to or removed from the collection based on the changeset- Overrides:
mergeChangesIntoObjectin classCollectionMapping
-
mergeAddRemoveChanges
protected void mergeAddRemoveChanges(java.lang.Object valueOfTarget, java.lang.Object delegateTarget, org.eclipse.persistence.internal.sessions.DirectCollectionChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Merge changes by adding and removing from the change record to the target object, and its delegate object if instance of IndirectCollection. It will also reorder the collection if required.
-
mergeIntoObject
public void mergeIntoObject(java.lang.Object target, boolean isTargetUnInitialized, java.lang.Object source, org.eclipse.persistence.internal.sessions.MergeManager mergeManager, org.eclipse.persistence.internal.sessions.AbstractSession targetSession)INTERNAL: Merge changes from the source to the target object.- Overrides:
mergeIntoObjectin classCollectionMapping
-
performDataModificationEvent
public void performDataModificationEvent(java.lang.Object[] event, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException, DescriptorExceptionINTERNAL: Perform the commit event. This is used in the uow to delay data modifications.- Overrides:
performDataModificationEventin classDatabaseMapping- Throws:
DatabaseExceptionDescriptorException
-
postCalculateChanges
public void postCalculateChanges(ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.- Overrides:
postCalculateChangesin classCollectionMapping
-
postInsert
public void postInsert(WriteObjectQuery query) throws DatabaseException
INTERNAL: Insert the private owned object.- Overrides:
postInsertin classCollectionMapping- Throws:
DatabaseException
-
getFieldValue
public java.lang.Object getFieldValue(java.lang.Object attributeValue, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Convert the attribute value to a field value. Process any converter if defined.
-
getObjectValue
public java.lang.Object getObjectValue(java.lang.Object fieldValue, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Convert the field value to an attribute value. Process any converter if defined.
-
getFieldsForTranslationInAggregate
public java.util.Vector getFieldsForTranslationInAggregate()
INTERNAL: Return source key fields for translation by an AggregateObjectMapping- Overrides:
getFieldsForTranslationInAggregatein classForeignReferenceMapping
-
postUpdate
public void postUpdate(WriteObjectQuery writeQuery) throws DatabaseException
INTERNAL: Update private owned part.- Overrides:
postUpdatein classDatabaseMapping- Throws:
DatabaseException
-
postUpdateWithChangeSet
protected void postUpdateWithChangeSet(WriteObjectQuery writeQuery) throws DatabaseException
INTERNAL: Update private owned part.- Throws:
DatabaseException
-
postUpdateWithChangeSetListOrder
protected void postUpdateWithChangeSetListOrder(WriteObjectQuery writeQuery) throws DatabaseException
INTERNAL: Update private owned part.- Throws:
DatabaseException
-
preDelete
public void preDelete(DeleteObjectQuery query) throws DatabaseException
INTERNAL: Delete private owned part. Which is a collection of objects from the reference table.- Overrides:
preDeletein classDatabaseMapping- Throws:
DatabaseException
-
prepareTranslationRow
protected void prepareTranslationRow(org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, java.lang.Object object, ClassDescriptor descriptor, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: The translation row may require additional fields than the primary key if the mapping in not on the primary key.- Overrides:
prepareTranslationRowin classCollectionMapping
-
initOrRebuildSelectQuery
protected void initOrRebuildSelectQuery()
INTERNAL: Used by DirectMapMapping to rebuild select query.
-
recordPrivateOwnedRemovals
public void recordPrivateOwnedRemovals(java.lang.Object object, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)INTERNAL: Overridden by mappings that require additional processing of the change record after the record has been calculated.- Overrides:
recordPrivateOwnedRemovalsin classCollectionMapping
-
remoteInitialization
public void remoteInitialization(DistributedSession session)
INTERNAL: Once descriptors are serialized to the remote session. All its mappings and reference descriptors are traversed. Usually mappings are initialized and serialized reference descriptors are replaced with local descriptors if they already exist on the remote session.- Overrides:
remoteInitializationin classForeignReferenceMapping
-
replaceValueHoldersIn
public java.util.Map replaceValueHoldersIn(java.lang.Object object, org.eclipse.persistence.internal.sessions.remote.RemoteSessionController controller)INTERNAL: replace the value holders in the specified reference object(s)- Overrides:
replaceValueHoldersInin classCollectionMapping
-
setAttributeClassification
public void setAttributeClassification(java.lang.Class attributeClassification)
PUBLIC: Some databases do not properly support all of the base data types. For these databases, the base data type must be explicitly specified in the mapping to tell EclipseLink to force the instance variable value to that data type.- Since:
- Java Persistence API 2.0 Migrated from AbstractDirectMapping
-
setAttributeClassificationName
public void setAttributeClassificationName(java.lang.String attributeClassificationName)
INTERNAL: Set the name of the class for MW usage.- Since:
- Java Persistence API 2.0 Migrated from AbstractDirectMapping
-
setDeleteQuery
protected void setDeleteQuery(ModifyQuery query)
-
setDeleteSQLString
public void setDeleteSQLString(java.lang.String sqlString)
PUBLIC: Set the receiver's delete SQL string. This allows the user to override the SQL generated by TopLink, with there own SQL or procedure call. The arguments are translated from the fields of the source row, through replacing the field names marked by '#' with the values for those fields. This SQL is responsible for doing the deletion required by the mapping, such as deletion from join table for M-M. Example, 'delete from RESPONS where EMP_ID = #EMP_ID and DESCRIP = #DESCRIP'.
-
setContainerPolicy
public void setContainerPolicy(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
ADVANCED: Configure the mapping to use a container policy. The policy manages the access to the collection.- Specified by:
setContainerPolicyin interfaceContainerMapping- Overrides:
setContainerPolicyin classCollectionMapping
-
setCustomDeleteQuery
public void setCustomDeleteQuery(ModifyQuery query)
PUBLIC: The default delete query for this mapping can be overridden by specifying the new query. This query is responsible for doing the deletion required by the mapping, such as deletion from join table for M-M. The query should delete a specific row from the DirectCollectionTable bases on the DirectField.
-
setCustomDeleteAtIndexQuery
public void setCustomDeleteAtIndexQuery(ModifyQuery query)
PUBLIC: The default delete by index query for this mapping can be overridden by specifying the new query. This query used (only in case listOrderField != null) to delete object with particular orderFieldValue.
-
setCustomInsertQuery
public void setCustomInsertQuery(DataModifyQuery query)
PUBLIC: The default insert query for mapping can be overridden by specifying the new query. This query inserts the row into the direct table.
-
setCustomUpdateAtIndexQuery
public void setCustomUpdateAtIndexQuery(ModifyQuery query)
PUBLIC: The default delete by index query for this mapping can be overridden by specifying the new query. This query used (only in case listOrderField != null) to update orderFieldValue of object with particular orderFieldValue.
-
setDirectField
public void setDirectField(org.eclipse.persistence.internal.helper.DatabaseField field)
PUBLIC: Set the direct field in the reference table. This is the field that the primitive data value is stored in.
-
setDirectFieldClassification
public void setDirectFieldClassification(java.lang.Class fieldType)
ADVANCED: Set the class type of the field value. This can be used if field value differs from the object value, has specific typing requirements such as usage of java.sql.Blob or NChar. This must be called after the field name has been set.
-
setDirectFieldClassificationName
public void setDirectFieldClassificationName(java.lang.String className)
ADVANCED: Set the class type of the field value. This can be used if field value differs from the object value, has specific typing requirements such as usage of java.sql.Blob or NChar. This must be called after the field name has been set.
-
setDirectFieldName
public void setDirectFieldName(java.lang.String fieldName)
PUBLIC: Set the direct field name in the reference table. This is the field that the primitive data value is stored in.
-
setHasCustomDeleteQuery
protected void setHasCustomDeleteQuery(boolean bool)
-
setHasCustomInsertQuery
protected void setHasCustomInsertQuery(boolean bool)
-
setInsertQuery
protected void setInsertQuery(DataModifyQuery insertQuery)
-
setInsertSQLString
public void setInsertSQLString(java.lang.String sqlString)
PUBLIC: Set the receiver's insert SQL string. This allows the user to override the SQL generated by TopLink, with there own SQL or procedure call. The arguments are translated from the fields of the source row, through replacing the field names marked by '#' with the values for those fields. This is used to insert an entry into the direct table.Example, 'insert into RESPONS (EMP_ID, RES_DESC) values (#EMP_ID, #RES_DESC)'.
-
setReferenceClass
public void setReferenceClass(java.lang.Class referenceClass)
INTERNAL: This cannot be used with direct collection mappings.- Overrides:
setReferenceClassin classForeignReferenceMapping
-
setReferenceClassName
public void setReferenceClassName(java.lang.String referenceClassName)
Description copied from class:ForeignReferenceMappingINTERNAL: Used by MW.- Overrides:
setReferenceClassNamein classForeignReferenceMapping
-
setReferenceKeyFieldName
public void setReferenceKeyFieldName(java.lang.String fieldName)
PUBLIC: Set the name of the reference key field. This is the foreign key field in the direct table referencing the primary key of the source object. This method is used if the reference key consists of only a single field.
-
setReferenceKeyFieldNames
public void setReferenceKeyFieldNames(java.util.Vector fieldNames)
INTERNAL: Set the reference key field names associated with the mapping. These must be in-order with the sourceKeyFieldNames.
-
setReferenceKeyFields
public void setReferenceKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> aVector)
INTERNAL: Set the reference fields.
-
setReferenceTable
public void setReferenceTable(org.eclipse.persistence.internal.helper.DatabaseTable table)
INTERNAL: Set the reference table.
-
setSelectionCriteria
public void setSelectionCriteria(Expression anExpression)
PUBLIC: Sets the selection criteria to be used as a where clause to read reference objects. This criteria is automatically generated by the TopLink if not explicitly specified by the user.- Overrides:
setSelectionCriteriain classForeignReferenceMapping
-
setReferenceTableName
public void setReferenceTableName(java.lang.String tableName)
PUBLIC: Set the reference table name.
-
setSelectionQueryContainerPolicy
protected void setSelectionQueryContainerPolicy(org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
INTERNAL: Set the container policy on the selection query for this mapping.- Overrides:
setSelectionQueryContainerPolicyin classCollectionMapping
-
setHistoryPolicy
public void setHistoryPolicy(HistoryPolicy policy)
PUBLIC: Support history on the reference table.
-
setSessionName
public void setSessionName(java.lang.String name)
PUBLIC: Set the name of the session to execute the mapping's queries under. This can be used by the session broker to override the default session to be used for the target class.- Overrides:
setSessionNamein classCollectionMapping
-
setSourceKeyFieldNames
public void setSourceKeyFieldNames(java.util.Vector fieldNames)
INTERNAL: Set the source key field names associated with the mapping. These must be in-order with the referenceKeyFieldNames.
-
setSourceKeyFields
public void setSourceKeyFields(java.util.Vector<org.eclipse.persistence.internal.helper.DatabaseField> sourceKeyFields)
INTERNAL: Set the source fields.
-
collectQueryParameters
public void collectQueryParameters(java.util.Set<org.eclipse.persistence.internal.helper.DatabaseField> cacheFields)
INTERNAL: This method is used to store the FK fields that can be cached that correspond to noncacheable mappings the FK field values will be used to re-issue the query when cloning the shared cache entity- Overrides:
collectQueryParametersin classCollectionMapping
-
calculateDeferredChanges
public void calculateDeferredChanges(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Used by AttributeLevelChangeTracking to update a changeRecord with calculated changes as apposed to detected changes. If an attribute can not be change tracked it's changes can be detected through this process.- Overrides:
calculateDeferredChangesin classCollectionMapping
-
simpleAddToCollectionChangeRecord
public void simpleAddToCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object objectToAdd, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.internal.sessions.AbstractSession session)ADVANCED: This method is used to have an object add to a collection once the changeSet is applied The referenceKey parameter should only be used for direct Maps.- Overrides:
simpleAddToCollectionChangeRecordin classCollectionMapping
-
simpleAddToCollectionChangeRecord
protected void simpleAddToCollectionChangeRecord(java.lang.Object objectToAdd, java.lang.Integer index, boolean isSet, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean isChangeApplied)
-
simpleRemoveFromCollectionChangeRecord
public void simpleRemoveFromCollectionChangeRecord(java.lang.Object referenceKey, java.lang.Object objectToRemove, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.internal.sessions.AbstractSession session)ADVANCED: This method is used to have an object removed from a collection once the changeSet is applied The referenceKey parameter should only be used for direct Maps.- Overrides:
simpleRemoveFromCollectionChangeRecordin classCollectionMapping
-
simpleRemoveFromCollectionChangeRecord
protected void simpleRemoveFromCollectionChangeRecord(java.lang.Object objectToRemove, java.lang.Integer index, boolean isSet, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean isChangeApplied)
-
updateChangeRecord
public void updateChangeRecord(java.lang.Object clone, java.lang.Object newValue, java.lang.Object oldValue, org.eclipse.persistence.internal.sessions.ObjectChangeSet objectChangeSet, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)INTERNAL: Either create a new change record or update with the new value. This is used by attribute change tracking. Specifically in a collection mapping this will be called when the customer Set a new collection. In this case we will need to mark the change record with the new and the old versions of the collection. And mark the ObjectChangeSet with the attribute name then when the changes are calculated force a compare on the collections to determine changes.- Overrides:
updateChangeRecordin classCollectionMapping
-
updateCollectionChangeRecord
public void updateCollectionChangeRecord(CollectionChangeEvent event, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl uow)
INTERNAL: Add or removes a new value and its change set to the collection change record based on the event passed in. This is used by attribute change tracking.- Overrides:
updateCollectionChangeRecordin classCollectionMapping
-
useMapClass
public void useMapClass(java.lang.Class concreteClass, java.lang.String methodName)PUBLIC: It is illegal to use a Map as the container of a DirectCollectionMapping. Only Collection containers are supported for DirectCollectionMappings.- Specified by:
useMapClassin interfaceContainerMapping- Overrides:
useMapClassin classCollectionMapping- See Also:
DirectMapMapping
-
valueFromRow
public java.lang.Object valueFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, org.eclipse.persistence.internal.sessions.AbstractSession session, boolean isTargetProtected, java.lang.Boolean[] wasCacheUsed) throws DatabaseExceptionINTERNAL: Return the value of the reference attribute or a value holder. Check whether the mapping's attribute should be optimized through batch and joining. Overridden to support flashback/historical queries.- Overrides:
valueFromRowin classForeignReferenceMapping- Throws:
DatabaseException
-
verifyDelete
public boolean verifyDelete(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseExceptionINTERNAL: Checks if object is deleted from the database or not.- Overrides:
verifyDeletein classCollectionMapping- Throws:
DatabaseException
-
isCandidateForPrivateOwnedRemoval
public boolean isCandidateForPrivateOwnedRemoval()
INTERNAL: DirectCollectionMapping contents should not be considered for addition to the UnitOfWork private owned objects list for removal.- Overrides:
isCandidateForPrivateOwnedRemovalin classDatabaseMapping
-
isCascadedLockingSupported
public boolean isCascadedLockingSupported()
INTERNAL Return true if this mapping supports cascaded version optimistic locking.- Overrides:
isCascadedLockingSupportedin classDatabaseMapping
-
-