Module org.eclipse.persistence.core
Package org.eclipse.persistence.mappings
Class MultitenantPrimaryKeyMapping
java.lang.Object
org.eclipse.persistence.core.mappings.CoreMapping<AttributeAccessor,AbstractSession,ContainerPolicy,ClassDescriptor,DatabaseField>
org.eclipse.persistence.mappings.DatabaseMapping
org.eclipse.persistence.mappings.foundation.AbstractColumnMapping
org.eclipse.persistence.mappings.MultitenantPrimaryKeyMapping
- All Implemented Interfaces:
Serializable
,Cloneable
Purpose: Maps a multitenant property to the corresponding database
field type. The list of field types that are supported by EclipseLink's
direct to field mapping is dependent on the relational database being used.
- Since:
- EclipseLink 2.4
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.persistence.mappings.DatabaseMapping
DatabaseMapping.WriteType
-
Field Summary
Fields inherited from class org.eclipse.persistence.mappings.foundation.AbstractColumnMapping
converter, converterClassName, field, isInsertable, isUpdatable
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
buildBackupClone
(Object clone, Object backup, UnitOfWorkImpl unitOfWork) INTERNAL: Clone the attribute from the clone and assign it to the backup.void
buildClone
(Object original, CacheKey cacheKey, Object clone, Integer refreshCascade, AbstractSession cloningSession) INTERNAL: Clone the attribute from the original and assign it to the clone.void
buildCloneFromRow
(AbstractRecord databaseRow, JoinedAttributeManager joinManager, Object clone, CacheKey sharedCacheKey, ObjectBuildingQuery sourceQuery, UnitOfWorkImpl unitOfWork, AbstractSession executionSession) INTERNAL: Extract value from the row and set the attribute to this value in the working copy clone.compareForChange
(Object clone, Object backUp, ObjectChangeSet owner, AbstractSession session) INTERNAL: Compare the clone and backup clone values and return a change record if the value changed.boolean
compareObjects
(Object firstObject, Object secondObject, AbstractSession session) INTERNAL: Compare the attributes belonging to this mapping for the objects.getFieldValue
(Object propertyValue, AbstractSession session) INTERNAL:getObjectValue
(Object fieldValue, Session session) INTERNAL:void
initialize
(AbstractSession session) INTERNAL: The mapping is initialized with the given session.boolean
INTERNAL: Return if this mapping requires its attribute value to be cloned.boolean
INTERNALboolean
INTERNAL:boolean
INTERNAL This mapping must be write only as their is no attribute to read into.void
mergeChangesIntoObject
(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager, AbstractSession targetSession) INTERNAL: Merge changes from the source to the target object.void
mergeIntoObject
(Object target, boolean isTargetUninitialized, Object source, MergeManager mergeManager, AbstractSession targetSession) INTERNAL: Merge changes from the source to the target object.void
setContextProperty
(String contextProperty) INTERNAL: The context property that is used to write this mapping must be set.valueFromObject
(Object anObject, DatabaseField field, AbstractSession session) INTERNAL: Return the Value from the object.void
writeFromObjectIntoRow
(Object object, AbstractRecord row, AbstractSession session, DatabaseMapping.WriteType writeType) INTERNAL: Get a value from the object and set that in the respective field of the row.void
writeInsertFieldsIntoRow
(AbstractRecord databaseRow, AbstractSession session) INTERNAL: Write fields needed for insert into the template for with null values.protected void
writeValueIntoRow
(AbstractRecord row, DatabaseField field, Object fieldValue) INTERNAL:Methods inherited from class org.eclipse.persistence.mappings.foundation.AbstractColumnMapping
cascadePerformRemoveIfRequired, cascadeRegisterNewIfRequired, clone, collectFields, convertClassNamesToClasses, fixObjectReferences, getConverter, getField, hasConverter, isAbstractColumnMapping, isInsertable, isUpdatable, iterate, setConverter, setConverterClassName, setField, toString
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
addUnconvertedProperty, buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildContainerClone, buildCopy, buildExpression, buildObjectJoinExpression, buildObjectJoinExpression, buildShallowOriginalFromRow, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cloneFields, collectQueryParameters, convertConverterClassNamesToClasses, createCloneValueHolder, derivesId, earlyPreDelete, extractNestedExpressions, extractNestedNonAggregateExpressions, fixRealObjectReferences, getAttributeAccessor, getAttributeClassification, getAttributeName, getAttributeValueFromObject, getContainerPolicy, getDerivedIdMapping, getDescriptor, getFieldClassification, getFields, getGetMethodName, getMapsIdValue, getObjectCorrespondingTo, getOrderByNormalizedExpressions, getProperties, getProperty, getRealAttributeValueFromAttribute, getRealAttributeValueFromObject, getRealCollectionAttributeValueFromObject, getReferenceDescriptor, getRelationshipPartner, getSelectFields, getSelectTables, getSetMethodName, getUnconvertedProperties, getValueFromRemoteValueHolder, getWeight, hasConstraintDependency, hasDependency, hasInverseConstraintDependency, hasMapsIdValue, hasNestedIdentityReference, hasRootExpressionThatShouldUseOuterJoin, hasUnconvertedProperties, instantiateAttribute, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isAttributeValueFromObjectInstantiated, isCacheable, isCandidateForPrivateOwnedRemoval, isCascadedLockingSupported, isChangeTrackingSupported, isCollectionMapping, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isElementCollectionMapping, isForeignReferenceMapping, isInAndOutSopObject, isInOnlySopObject, isInSopObject, isJoiningSupported, isJPAId, isLazy, isLockableMapping, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isOutOnlySopObject, isOutSopObject, isOwned, isPrimaryKeyMapping, isPrivateOwned, isReadOnly, isReferenceMapping, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, isXMLMapping, iterateOnRealAttributeValue, load, loadAll, performDataModificationEvent, postCalculateChanges, postCalculateChangesOnDeleted, postDelete, postInitialize, postInitializeSourceAndTargetExpressions, postInsert, postUpdate, preDelete, preInitialize, preInsert, prepareCascadeLockingPolicy, preUpdate, readFromResultSetIntoObject, readFromRowIntoObject, readOnly, readWrite, recordPrivateOwnedRemovals, rehashFieldDependancies, remoteInitialization, remotelyInitialized, replaceValueHoldersIn, setAttributeAccessor, setAttributeName, setAttributeValueInObject, setChangeListener, setDerivedIdMapping, setDerivesId, setDescriptor, setFields, setGetMethodName, setIsCacheable, setIsInAndOutSopObject, setIsInSopObject, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsOutSopObject, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setRealAttributeValueInObject, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, updateChangeRecord, updateCollectionChangeRecord, validateAfterInitialization, validateBeforeInitialization, valueFromResultSet, valueFromRow, valueFromRow, verifyDelete, writeFromAttributeIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowForUpdateAfterShallowInsert, writeFromObjectIntoRowForUpdateBeforeShallowDelete, writeFromObjectIntoRowForWhereClause, writeFromObjectIntoRowWithChangeRecord, writeUpdateFieldsIntoRow
-
Constructor Details
-
MultitenantPrimaryKeyMapping
public MultitenantPrimaryKeyMapping()Constructor
-
-
Method Details
-
buildBackupClone
INTERNAL: Clone the attribute from the clone and assign it to the backup. This is an override from DatabaseMapping and must be implemented.- Specified by:
buildBackupClone
in classDatabaseMapping
- Parameters:
clone
- TODObackup
- TODOunitOfWork
- TODO
-
buildClone
public void buildClone(Object original, CacheKey cacheKey, Object clone, Integer refreshCascade, AbstractSession cloningSession) INTERNAL: Clone the attribute from the original and assign it to the clone. This is an override from DatabaseMapping and must be implemented.- Specified by:
buildClone
in classDatabaseMapping
- Parameters:
original
- TODOcacheKey
- TODOclone
- TODOrefreshCascade
- TODOcloningSession
- TODO
-
buildCloneFromRow
public void buildCloneFromRow(AbstractRecord databaseRow, JoinedAttributeManager joinManager, Object clone, CacheKey sharedCacheKey, ObjectBuildingQuery sourceQuery, UnitOfWorkImpl unitOfWork, AbstractSession executionSession) INTERNAL: Extract value from the row and set the attribute to this value in the working copy clone. In order to bypass the shared cache when in transaction a UnitOfWork must be able to populate working copies directly from the row.- Specified by:
buildCloneFromRow
in classDatabaseMapping
- Parameters:
databaseRow
- TODOjoinManager
- TODOclone
- TODOsharedCacheKey
- TODOsourceQuery
- TODOunitOfWork
- TODOexecutionSession
- TODO
-
compareForChange
public ChangeRecord compareForChange(Object clone, Object backUp, ObjectChangeSet owner, AbstractSession session) INTERNAL: Compare the clone and backup clone values and return a change record if the value changed. This is an override from DatabaseMapping and must be implemented.- Specified by:
compareForChange
in classDatabaseMapping
- Parameters:
clone
- TODObackUp
- TODOowner
- TODOsession
- TODO- Returns:
- prototype.changeset.ChangeRecord TODO
-
compareObjects
INTERNAL: Compare the attributes belonging to this mapping for the objects. This is an override from DatabaseMapping and must be implemented.- Specified by:
compareObjects
in classDatabaseMapping
- Parameters:
firstObject
- TODOsecondObject
- TODOsession
- TODO- Returns:
- TODO
-
getFieldValue
INTERNAL:- Specified by:
getFieldValue
in classAbstractColumnMapping
-
getObjectValue
INTERNAL:- Specified by:
getObjectValue
in classAbstractColumnMapping
-
initialize
INTERNAL: The mapping is initialized with the given session. This mapping is fully initialized after this.- Overrides:
initialize
in classDatabaseMapping
- Throws:
DescriptorException
-
isCloningRequired
public boolean isCloningRequired()INTERNAL: Return if this mapping requires its attribute value to be cloned.- Overrides:
isCloningRequired
in classDatabaseMapping
-
isMultitenantPrimaryKeyMapping
public boolean isMultitenantPrimaryKeyMapping()INTERNAL- Overrides:
isMultitenantPrimaryKeyMapping
in classDatabaseMapping
-
isRelationalMapping
public boolean isRelationalMapping()INTERNAL:- Overrides:
isRelationalMapping
in classDatabaseMapping
-
isWriteOnly
public boolean isWriteOnly()INTERNAL This mapping must be write only as their is no attribute to read into.- Overrides:
isWriteOnly
in classDatabaseMapping
- Returns:
- TODO
-
mergeChangesIntoObject
public void mergeChangesIntoObject(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager, AbstractSession targetSession) INTERNAL: Merge changes from the source to the target object. This is an override from DatabaseMapping and must be implemented.- Specified by:
mergeChangesIntoObject
in classDatabaseMapping
-
mergeIntoObject
public void mergeIntoObject(Object target, boolean isTargetUninitialized, Object source, MergeManager mergeManager, AbstractSession targetSession) INTERNAL: Merge changes from the source to the target object. This merge is only called when a changeSet for the target does not exist or the target is uninitialized This is an override from DatabaseMapping and must be implemented.- Specified by:
mergeIntoObject
in classDatabaseMapping
-
setContextProperty
INTERNAL: The context property that is used to write this mapping must be set. It is set as the attribute name (which gets set on the accessor) -
writeFromObjectIntoRow
public void writeFromObjectIntoRow(Object object, AbstractRecord row, AbstractSession session, DatabaseMapping.WriteType writeType) INTERNAL: Get a value from the object and set that in the respective field of the row.- Overrides:
writeFromObjectIntoRow
in classDatabaseMapping
-
valueFromObject
INTERNAL: Return the Value from the object.- Overrides:
valueFromObject
in classDatabaseMapping
- Parameters:
anObject
- TODOfield
- TODOsession
- TODO- Returns:
- TODO
-
writeInsertFieldsIntoRow
INTERNAL: Write fields needed for insert into the template for with null values.- Overrides:
writeInsertFieldsIntoRow
in classDatabaseMapping
-
writeValueIntoRow
INTERNAL:- Specified by:
writeValueIntoRow
in classAbstractColumnMapping
-