EclipseLink 2.4.0, build 'v20111118-r10419' API Reference

org.eclipse.persistence.mappings
Class MultitenantPrimaryKeyMapping

java.lang.Object
  extended by org.eclipse.persistence.mappings.DatabaseMapping
      extended by org.eclipse.persistence.mappings.foundation.AbstractDirectMapping
          extended by org.eclipse.persistence.mappings.MultitenantPrimaryKeyMapping
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class MultitenantPrimaryKeyMapping
extends AbstractDirectMapping

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.

See Also:
Serialized Form
Author:
Guy Pelletier
Since:
EclipseLink 2.4

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.AbstractDirectMapping
field
 
Fields inherited from class org.eclipse.persistence.mappings.DatabaseMapping
attributeAccessor, attributeName, derivedIdMapping, derivesId, descriptor, fields, isCacheable, isJPAId, isLazy, isMapKeyMapping, isOptional, isPrimaryKeyMapping, isReadOnly, isRemotelyInitialized, mapsIdValue, NO_FIELDS, NO_WEIGHT, properties, weight, WEIGHT_AGGREGATE, WEIGHT_DIRECT, WEIGHT_TO_ONE, WEIGHT_TRANSFORM
 
Constructor Summary
MultitenantPrimaryKeyMapping()
          Constructor
 
Method Summary
 void buildBackupClone(java.lang.Object clone, java.lang.Object backup, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
          INTERNAL: Clone the attribute from the clone and assign it to the backup.
 void buildClone(java.lang.Object original, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, java.lang.Object clone, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession)
          INTERNAL: Clone the attribute from the original and assign it to the clone.
 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: Compare the clone and backup clone values and return a change record if the value changed.
 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.
 java.lang.Object getFieldValue(java.lang.Object propertyValue, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL:
 java.lang.Object getObjectValue(java.lang.Object fieldValue, Session session)
          INTERNAL:
 void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: The mapping is initialized with the given session.
 boolean isMultitenantPrimaryKeyMapping()
          INTERNAL
 boolean isRelationalMapping()
          INTERNAL:
 boolean isWriteOnly()
          INTERNAL This mapping must be write only as their is no attribute to read into.
 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.
 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.
 void setAttributeClassification(java.lang.Class attributeClassification)
          PUBLIC: Some databases do not properly support all of the base data types.
 void setContextProperty(java.lang.String contextProperty)
          INTERNAL: The context property that is used to write this mapping must be set.
 java.lang.Object valueFromObject(java.lang.Object anObject, org.eclipse.persistence.internal.helper.DatabaseField field, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Return the Value from the object.
protected  void writeValueIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.helper.DatabaseField field, java.lang.Object fieldValue)
          INTERNAL:
 
Methods inherited from class org.eclipse.persistence.mappings.foundation.AbstractDirectMapping
buildCloneFromRow, buildExpression, buildShallowOriginalFromRow, cascadePerformRemoveIfRequired, cascadeRegisterNewIfRequired, clone, collectFields, fixObjectReferences, getAttributeClassificationName, getAttributeValue, getConverter, getField, getFieldClassification, getFieldName, getNullValue, getReferenceDescriptor, getWeight, hasConverter, isAbstractDirectMapping, isCloningRequired, isInsertable, isMutable, isUpdatable, iterate, setAttributeClassificationName, setConverter, setField, setFieldClassification, setFieldType, setIsMutable, setNullValue, toString, validateBeforeInitialization, writeFromObjectIntoRow, writeFromObjectIntoRowForUpdate, writeFromObjectIntoRowWithChangeRecord, writeInsertFieldsIntoRow, writeUpdateFieldsIntoRow
 
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
buildBackupCloneForPartObject, buildChangeRecord, buildCloneForPartObject, buildContainerClone, buildCopy, buildObjectJoinExpression, buildObjectJoinExpression, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cloneFields, collectQueryParameters, convertClassNamesToClasses, createCloneValueHolder, derivesId, earlyPreDelete, extractNestedExpressions, fixRealObjectReferences, getAttributeAccessor, getAttributeClassification, getAttributeName, getAttributeValueFromObject, getContainerPolicy, getDerivedIdMapping, getDescriptor, getFieldClassification, getFields, getGetMethodName, getMapsIdValue, getObjectCorrespondingTo, getProperties, getProperty, getRealAttributeValueFromAttribute, getRealAttributeValueFromObject, getRealCollectionAttributeValueFromObject, getRelationshipPartner, getSelectFields, getSelectTables, getSetMethodName, getValueFromRemoteValueHolder, hasConstraintDependency, hasDependency, hasInverseConstraintDependency, hasMapsIdValue, hasRootExpressionThatShouldUseOuterJoin, instantiateAttribute, isAbstractAttributeDirectMapping, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCacheable, isCandidateForPrivateOwnedRemoval, isCascadedLockingSupported, isChangeTrackingSupported, isCollectionMapping, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isElementCollectionMapping, isForeignReferenceMapping, isJoiningSupported, isJPAId, isLazy, isLockableMapping, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isOwned, isPrimaryKeyMapping, isPrivateOwned, isReadOnly, isReferenceMapping, isRemotelyInitialized, isStructureMapping, isTransformationMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, isXMLMapping, iterateOnRealAttributeValue, performDataModificationEvent, postCalculateChanges, postCalculateChangesOnDeleted, postDelete, postInitialize, 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, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setRealAttributeValueInObject, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, updateChangeRecord, updateCollectionChangeRecord, validateAfterInitialization, valueFromResultSet, valueFromRow, valueFromRow, verifyDelete, writeFromAttributeIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForWhereClause
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultitenantPrimaryKeyMapping

public MultitenantPrimaryKeyMapping()
Constructor

Method Detail

buildBackupClone

public void buildBackupClone(java.lang.Object clone,
                             java.lang.Object backup,
                             org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)
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 class DatabaseMapping

buildClone

public void buildClone(java.lang.Object original,
                       org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey,
                       java.lang.Object clone,
                       org.eclipse.persistence.internal.sessions.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 class DatabaseMapping

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: 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 class DatabaseMapping
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. This is an override from DatabaseMapping and must be implemented.

Specified by:
compareObjects in class DatabaseMapping

getFieldValue

public java.lang.Object getFieldValue(java.lang.Object propertyValue,
                                      org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:

Specified by:
getFieldValue in class AbstractDirectMapping

getObjectValue

public java.lang.Object getObjectValue(java.lang.Object fieldValue,
                                       Session session)
INTERNAL:

Specified by:
getObjectValue in class AbstractDirectMapping

initialize

public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session)
                throws DescriptorException
INTERNAL: The mapping is initialized with the given session. This mapping is fully initialized after this.

Overrides:
initialize in class DatabaseMapping
Throws:
DescriptorException

isMultitenantPrimaryKeyMapping

public boolean isMultitenantPrimaryKeyMapping()
INTERNAL

Overrides:
isMultitenantPrimaryKeyMapping in class DatabaseMapping

isRelationalMapping

public boolean isRelationalMapping()
INTERNAL:

Overrides:
isRelationalMapping in class DatabaseMapping

isWriteOnly

public boolean isWriteOnly()
INTERNAL This mapping must be write only as their is no attribute to read into.

Overrides:
isWriteOnly in class DatabaseMapping

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. This is an override from DatabaseMapping and must be implemented.

Specified by:
mergeChangesIntoObject in class DatabaseMapping

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. 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 class DatabaseMapping

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

Specified by:
setAttributeClassification in class AbstractDirectMapping
See Also:
org.eclipse.persistence.mappings.foundation.AbstractAttributeDirectMapping.setAttributeClassification(Class)

setContextProperty

public void setContextProperty(java.lang.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)


valueFromObject

public java.lang.Object valueFromObject(java.lang.Object anObject,
                                        org.eclipse.persistence.internal.helper.DatabaseField field,
                                        org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Return the Value from the object.

Overrides:
valueFromObject in class DatabaseMapping

writeValueIntoRow

protected void writeValueIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                 org.eclipse.persistence.internal.helper.DatabaseField field,
                                 java.lang.Object fieldValue)
INTERNAL:

Specified by:
writeValueIntoRow in class AbstractDirectMapping

EclipseLink 2.4.0, build 'v20111118-r10419' API Reference