Top Description Fields Constructors Methods
org.eclipse.persistence.mappings

public Class MultitenantPrimaryKeyMapping

extends AbstractColumnMapping
Class Inheritance
Imports
org.eclipse.persistence.exceptions.DescriptorException, org.eclipse.persistence.internal.descriptors.MultitenantPrimaryKeyAccessor, org.eclipse.persistence.internal.helper.DatabaseField, org.eclipse.persistence.internal.identitymaps.CacheKey, org.eclipse.persistence.internal.queries.JoinedAttributeManager, org.eclipse.persistence.internal.sessions.AbstractRecord, .AbstractSession, .ChangeRecord, .MergeManager, .ObjectChangeSet, .UnitOfWorkImpl, org.eclipse.persistence.mappings.foundation.AbstractColumnMapping, org.eclipse.persistence.queries.ObjectBuildingQuery, org.eclipse.persistence.sessions.Session

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.
Author
Guy Pelletier
Since
EclipseLink 2.4

Field Summary

Modifier and TypeField and Description
private MultitenantPrimaryKeyAccessor
Inherited from org.eclipse.persistence.mappings.foundation.AbstractColumnMapping:
converterconverterClassNamefieldisInsertableisUpdatable

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
buildBackupClone(Object
TODO
clone
,
Object
TODO
backup
,
UnitOfWorkImpl
TODO
unitOfWork
)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.buildBackupClone.

INTERNAL: Clone the attribute from the clone and assign it to the backup.
public void
buildClone(Object
TODO
original
,
CacheKey
TODO
cacheKey
,
Object
TODO
clone
,
Integer
TODO
refreshCascade
,
AbstractSession
TODO
cloningSession
)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.buildClone.

INTERNAL: Clone the attribute from the original and assign it to the clone.
public void
buildCloneFromRow(AbstractRecord
TODO
databaseRow
,
JoinedAttributeManager
TODO
joinManager
,
Object
TODO
clone
,
CacheKey
TODO
sharedCacheKey
,
ObjectBuildingQuery
TODO
sourceQuery
,
UnitOfWorkImpl
TODO
unitOfWork
,
AbstractSession
TODO
executionSession
)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.buildCloneFromRow.

INTERNAL: Extract value from the row and set the attribute to this value in the working copy clone.
public ChangeRecord
compareForChange(Object
TODO
clone
,
Object
TODO
backUp
,
ObjectChangeSet
TODO
owner
,
AbstractSession
TODO
session
)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.compareForChange.

INTERNAL: Compare the clone and backup clone values and return a change record if the value changed.
public boolean
compareObjects(Object
TODO
firstObject
,
Object
TODO
secondObject
,
AbstractSession
TODO
session
)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.compareObjects.

INTERNAL: Compare the attributes belonging to this mapping for the objects.
public Object
public Object
public void
initialize(AbstractSession session)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.initialize.

INTERNAL: The mapping is initialized with the given session.
public boolean
isCloningRequired()

Overrides org.eclipse.persistence.mappings.DatabaseMapping.isCloningRequired.

INTERNAL: Return if this mapping requires its attribute value to be cloned.
public boolean
public boolean
public boolean
isWriteOnly()

Overrides org.eclipse.persistence.mappings.DatabaseMapping.isWriteOnly.

INTERNAL This mapping must be write only as their is no attribute to read into.
public void
mergeChangesIntoObject(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager, AbstractSession targetSession)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.mergeChangesIntoObject.

INTERNAL: Merge changes from the source to the target object.
public void
mergeIntoObject(Object target, boolean isTargetUninitialized, Object source, MergeManager mergeManager, AbstractSession targetSession)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.mergeIntoObject.

INTERNAL: Merge changes from the source to the target object.
public void
setContextProperty(String contextProperty)

INTERNAL: The context property that is used to write this mapping must be set.

public Object
valueFromObject(Object
TODO
anObject
,
DatabaseField
TODO
field
,
AbstractSession
TODO
session
)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.valueFromObject.

INTERNAL: Return the Value from the object.
public void
writeFromObjectIntoRow(Object object, AbstractRecord row, AbstractSession session, DatabaseMapping.WriteType writeType)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.writeFromObjectIntoRow.

INTERNAL: Get a value from the object and set that in the respective field of the row.
public void
writeInsertFieldsIntoRow(AbstractRecord databaseRow, AbstractSession session)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.writeInsertFieldsIntoRow.

INTERNAL: Write fields needed for insert into the template for with null values.
protected void
Inherited from org.eclipse.persistence.mappings.foundation.AbstractColumnMapping:
cascadePerformRemoveIfRequiredcascadeRegisterNewIfRequiredclonecollectFieldsconvertClassNamesToClassesfixObjectReferencesgetConvertergetFieldhasConverterisAbstractColumnMappingisInsertableisUpdatableiteratesetConvertersetConverterClassNamesetFieldtoString

Field Detail

accessorback to summary
private MultitenantPrimaryKeyAccessor accessor

Constructor Detail

MultitenantPrimaryKeyMappingback to summary
public MultitenantPrimaryKeyMapping()

Constructor

Method Detail

buildBackupCloneback to summary
public void buildBackupClone(Object clone, Object backup, UnitOfWorkImpl unitOfWork)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.buildBackupClone.

INTERNAL: Clone the attribute from the clone and assign it to the backup. This is an override from DatabaseMapping and must be implemented.

Parameters
clone:Object

Doc from org.eclipse.persistence.mappings.DatabaseMapping.buildBackupClone.

TODO

backup:Object

Doc from org.eclipse.persistence.mappings.DatabaseMapping.buildBackupClone.

TODO

unitOfWork:UnitOfWorkImpl

Doc from org.eclipse.persistence.mappings.DatabaseMapping.buildBackupClone.

TODO

Annotations
@Override
buildCloneback to summary
public void buildClone(Object original, CacheKey cacheKey, Object clone, Integer refreshCascade, AbstractSession cloningSession)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.buildClone.

INTERNAL: Clone the attribute from the original and assign it to the clone. This is an override from DatabaseMapping and must be implemented.

Parameters
original:Object

Doc from org.eclipse.persistence.mappings.DatabaseMapping.buildClone.

TODO

cacheKey:CacheKey

Doc from org.eclipse.persistence.mappings.DatabaseMapping.buildClone.

TODO

clone:Object

Doc from org.eclipse.persistence.mappings.DatabaseMapping.buildClone.

TODO

refreshCascade:Integer

Doc from org.eclipse.persistence.mappings.DatabaseMapping.buildClone.

TODO

cloningSession:AbstractSession

Doc from org.eclipse.persistence.mappings.DatabaseMapping.buildClone.

TODO

Annotations
@Override
buildCloneFromRowback to summary
public void buildCloneFromRow(AbstractRecord databaseRow, JoinedAttributeManager joinManager, Object clone, CacheKey sharedCacheKey, ObjectBuildingQuery sourceQuery, UnitOfWorkImpl unitOfWork, AbstractSession executionSession)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.buildCloneFromRow.

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.

Parameters
databaseRow:AbstractRecord

Doc from org.eclipse.persistence.mappings.DatabaseMapping.buildCloneFromRow.

TODO

joinManager:JoinedAttributeManager

Doc from org.eclipse.persistence.mappings.DatabaseMapping.buildCloneFromRow.

TODO

clone:Object

Doc from org.eclipse.persistence.mappings.DatabaseMapping.buildCloneFromRow.

TODO

sharedCacheKey:CacheKey

Doc from org.eclipse.persistence.mappings.DatabaseMapping.buildCloneFromRow.

TODO

sourceQuery:ObjectBuildingQuery

Doc from org.eclipse.persistence.mappings.DatabaseMapping.buildCloneFromRow.

TODO

unitOfWork:UnitOfWorkImpl

Doc from org.eclipse.persistence.mappings.DatabaseMapping.buildCloneFromRow.

TODO

executionSession:AbstractSession

Doc from org.eclipse.persistence.mappings.DatabaseMapping.buildCloneFromRow.

TODO

Annotations
@Override
compareForChangeback to summary
public ChangeRecord compareForChange(Object clone, Object backUp, ObjectChangeSet owner, AbstractSession session)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.compareForChange.

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.

Parameters
clone:Object

Doc from org.eclipse.persistence.mappings.DatabaseMapping.compareForChange.

TODO

backUp:Object

Doc from org.eclipse.persistence.mappings.DatabaseMapping.compareForChange.

TODO

owner:ObjectChangeSet

Doc from org.eclipse.persistence.mappings.DatabaseMapping.compareForChange.

TODO

session:AbstractSession

Doc from org.eclipse.persistence.mappings.DatabaseMapping.compareForChange.

TODO

Returns:ChangeRecord

Doc from org.eclipse.persistence.mappings.DatabaseMapping.compareForChange.

prototype.changeset.ChangeRecord TODO

Annotations
@Override
compareObjectsback to summary
public boolean compareObjects(Object firstObject, Object secondObject, AbstractSession session)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.compareObjects.

INTERNAL: Compare the attributes belonging to this mapping for the objects. This is an override from DatabaseMapping and must be implemented.

Parameters
firstObject:Object

Doc from org.eclipse.persistence.mappings.DatabaseMapping.compareObjects.

TODO

secondObject:Object

Doc from org.eclipse.persistence.mappings.DatabaseMapping.compareObjects.

TODO

session:AbstractSession

Doc from org.eclipse.persistence.mappings.DatabaseMapping.compareObjects.

TODO

Returns:boolean

Doc from org.eclipse.persistence.mappings.DatabaseMapping.compareObjects.

TODO

Annotations
@Override
getFieldValueback to summary
public Object getFieldValue(Object propertyValue, AbstractSession session)

Implements abstract org.eclipse.persistence.mappings.foundation.AbstractColumnMapping.getFieldValue.

INTERNAL:

Annotations
@Override
getObjectValueback to summary
public Object getObjectValue(Object fieldValue, Session session)

Implements abstract org.eclipse.persistence.mappings.foundation.AbstractColumnMapping.getObjectValue.

INTERNAL:

Annotations
@Override
initializeback to summary
public void initialize(AbstractSession session) throws DescriptorException

Overrides org.eclipse.persistence.mappings.DatabaseMapping.initialize.

INTERNAL: The mapping is initialized with the given session. This mapping is fully initialized after this.

Annotations
@Override
isCloningRequiredback to summary
public boolean isCloningRequired()

Overrides org.eclipse.persistence.mappings.DatabaseMapping.isCloningRequired.

INTERNAL: Return if this mapping requires its attribute value to be cloned.

Annotations
@Override
isMultitenantPrimaryKeyMappingback to summary
public boolean isMultitenantPrimaryKeyMapping()

Overrides org.eclipse.persistence.mappings.DatabaseMapping.isMultitenantPrimaryKeyMapping.

INTERNAL

Annotations
@Override
isRelationalMappingback to summary
public boolean isRelationalMapping()

Overrides org.eclipse.persistence.mappings.DatabaseMapping.isRelationalMapping.

INTERNAL:

Annotations
@Override
isWriteOnlyback to summary
public boolean isWriteOnly()

Overrides org.eclipse.persistence.mappings.DatabaseMapping.isWriteOnly.

INTERNAL This mapping must be write only as their is no attribute to read into.

Returns:boolean

Doc from org.eclipse.persistence.core.mappings.CoreMapping.isWriteOnly.

TODO

Annotations
@Override
mergeChangesIntoObjectback to summary
public void mergeChangesIntoObject(Object target, ChangeRecord changeRecord, Object source, MergeManager mergeManager, AbstractSession targetSession)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.mergeChangesIntoObject.

INTERNAL: Merge changes from the source to the target object. This is an override from DatabaseMapping and must be implemented.

Annotations
@Override
mergeIntoObjectback to summary
public void mergeIntoObject(Object target, boolean isTargetUninitialized, Object source, MergeManager mergeManager, AbstractSession targetSession)

Implements abstract org.eclipse.persistence.mappings.DatabaseMapping.mergeIntoObject.

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.

Annotations
@Override
setContextPropertyback to summary
public void setContextProperty(String contextProperty)

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)

valueFromObjectback to summary
public Object valueFromObject(Object anObject, DatabaseField field, AbstractSession session)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.valueFromObject.

INTERNAL: Return the Value from the object.

Parameters
anObject:Object

Doc from org.eclipse.persistence.core.mappings.CoreMapping.valueFromObject.

TODO

field:DatabaseField

Doc from org.eclipse.persistence.core.mappings.CoreMapping.valueFromObject.

TODO

session:AbstractSession

Doc from org.eclipse.persistence.core.mappings.CoreMapping.valueFromObject.

TODO

Returns:Object

Doc from org.eclipse.persistence.core.mappings.CoreMapping.valueFromObject.

TODO

Annotations
@Override
writeFromObjectIntoRowback to summary
public void writeFromObjectIntoRow(Object object, AbstractRecord row, AbstractSession session, DatabaseMapping.WriteType writeType)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.writeFromObjectIntoRow.

INTERNAL: Get a value from the object and set that in the respective field of the row.

Annotations
@Override
writeInsertFieldsIntoRowback to summary
public void writeInsertFieldsIntoRow(AbstractRecord databaseRow, AbstractSession session)

Overrides org.eclipse.persistence.mappings.DatabaseMapping.writeInsertFieldsIntoRow.

INTERNAL: Write fields needed for insert into the template for with null values.

Annotations
@Override
writeValueIntoRowback to summary
protected void writeValueIntoRow(AbstractRecord row, DatabaseField field, Object fieldValue)

Implements abstract org.eclipse.persistence.mappings.foundation.AbstractColumnMapping.writeValueIntoRow.

INTERNAL:

Annotations
@Override