Class AbstractTransformationMapping
- 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.foundation.AbstractTransformationMapping
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
EISTransformationMapping,TransformationMapping,XMLTransformationMapping
public abstract class AbstractTransformationMapping extends DatabaseMapping
Purpose: A transformation mapping is used for a specialized translation between how a value is represented in Java and its representation on the databae. Transformation mappings should only be used when other mappings are inadequate.
- See Also:
- Serialized Form
- Author:
- Sati
- Since:
- TOPLink/Java 1.0
-
-
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 AttributeTransformerattributeTransformerattributeTransformerClassName is converter to an instance of AttributeTransformerprotected java.lang.StringattributeTransformerClassNameName of the class which implements AttributeTransformer to be used to retrieve the attribute valueprotected java.util.List<java.lang.Object[]>fieldToTransformersThe TransformerClassNames are converted into instances of FieldTransformerprotected java.util.List<org.eclipse.persistence.internal.descriptors.FieldTransformation>fieldTransformationsStores field name and the class name of a FieldTransformer in a vector to preserve orderprotected org.eclipse.persistence.internal.indirection.IndirectionPolicyindirectionPolicyImplements indirection behaviourprotected booleanisMutablePERF: Indicates if this mapping's attribute is a simple value which cannot be modified only replaced.-
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 AbstractTransformationMapping()PUBLIC: Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFieldTransformation(java.lang.String fieldName, java.lang.String methodName)PUBLIC: Add the name of field and the name of the method that returns the value to be placed in said field when the object is written to the database.voidaddFieldTransformation(org.eclipse.persistence.internal.helper.DatabaseField field, java.lang.String methodName)PUBLIC: Add the field and the name of the method that returns the value to be placed in said field when the object is written to the database.voidaddFieldTransformer(java.lang.String fieldName, FieldTransformer transformer)PUBLIC: Add the name of field and the transformer that returns the value to be placed in the field when the object is written to the database.voidaddFieldTransformer(org.eclipse.persistence.internal.helper.DatabaseField field, FieldTransformer transformer)PUBLIC: Add the field and the transformer that returns the value to be placed in the field when the object is written to the database.voidaddFieldTransformerClassName(java.lang.String fieldName, java.lang.String className)INTERNAL: Add the name of a field and the name of a class which implements the FieldTransformer interface.voidaddFieldTransformerClassName(org.eclipse.persistence.internal.helper.DatabaseField field, java.lang.String className)INTERNAL: Add the name of a field and the name of a class which implements the FieldTransformer interface.protected booleanareObjectsToBeProcessedInstantiated(java.lang.Object object)INTERNAL: The referenced object is checked if it is instantiated or notvoidbuildBackupClone(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.java.lang.ObjectbuildBackupCloneForPartObject(java.lang.Object attributeValue, java.lang.Object clone, java.lang.Object backup, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)INTERNAL: Used during building the backup shallow copy to copy the vector without re-registering the target objects.org.eclipse.persistence.internal.sessions.ChangeRecordbuildChangeRecord(java.lang.Object clone, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Directly build a change record without comparisonvoidbuildClone(java.lang.Object original, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, java.lang.Object clone, java.lang.Integer refreshCascade, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession)INTERNAL: Clone the attribute from the original and assign it to the clone.java.lang.ObjectbuildCloneForPartObject(java.lang.Object attributeValue, java.lang.Object original, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, java.lang.Object clone, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession, java.lang.Integer refreshCascade, boolean isExisting, boolean isFromSharedCache)INTERNAL: Require for cloning, the part must be cloned.voidbuildCloneFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord record, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, java.lang.Object clone, org.eclipse.persistence.internal.identitymaps.CacheKey sharedCacheKey, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)INTERNAL: Extract value from the row and set the attribute to this value in the working copy clone.voidbuildCopy(java.lang.Object copy, java.lang.Object original, CopyGroup group)INTERNAL: Copy of the attribute of the object.protected org.eclipse.persistence.internal.sessions.AbstractRecordbuildPhantomRowFrom(java.lang.Object domainObject, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL Build a phantom row that contains only the fields for the mapping, populated with the values generated by invoking the field methods on the specified object.voidbuildShallowOriginalFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord record, java.lang.Object original, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery query, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)INTERNAL: Builds a shallow original object.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 cascadevoidcascadeRegisterNewIfRequired(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.protected java.util.VectorcollectFields()INTERNAL: Return all the fields with this mapping.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: Compare the attributes belonging to this mapping for the objects.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 settingsorg.eclipse.persistence.internal.indirection.DatabaseValueHoldercreateCloneValueHolder(ValueHolderInterface attributeValue, java.lang.Object original, java.lang.Object clone, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession, boolean buildDirectlyFromRow)INTERNAL: Builder the unit of work value holder.voiddontUseIndirection()PUBLIC: Indirection means that a ValueHolder will be put in-between the attribute and the real object.voidfixObjectReferences(java.lang.Object object, java.util.Map objectDescriptors, java.util.Map processedObjects, ObjectLevelReadQuery query, DistributedSession session)INTERNAL: An object has been serialized from the server to the client.java.lang.StringgetAttributeMethodName()PUBLIC: Return the attribute transformation method name.AttributeTransformergetAttributeTransformer()INTERNAL: The attributeTransformer stores an instance of the class which implements AttributeTransformer.java.lang.ClassgetAttributeTransformerClass()INTERNAL: Return the attribute transformer's class.java.lang.StringgetAttributeTransformerClassName()INTERNAL: Return the attribute transformer class namejava.lang.ObjectgetAttributeValueFromObject(java.lang.Object object)INTERNAL: Check for write-only, one-way transformation.java.util.VectorgetFieldNameToMethodNameAssociations()INTERNAL: Needed for backwards compatibilityjava.util.HashtablegetFieldNameToMethodNames()INTERNAL: Required for reverse compatibility and test cases:java.util.List<java.lang.Object[]>getFieldToTransformers()INTERNAL:java.util.List<org.eclipse.persistence.internal.descriptors.FieldTransformation>getFieldTransformations()INTERNAL: Returns a Vector which stores fieldnames and the respective method/transformer names.org.eclipse.persistence.internal.indirection.IndirectionPolicygetIndirectionPolicy()INTERNAL: Return the mapping's indirection policy.java.lang.ObjectgetRealAttributeValueFromAttribute(java.lang.Object attributeValue, java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Returns the real attribute value from the reference object's attribute value.java.lang.ObjectgetValueFromRemoteValueHolder(org.eclipse.persistence.internal.sessions.remote.RemoteValueHolder remoteValueHolder)INTERNAL: Extract and return the appropriate value from the specified remote value holder.voidinitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: The mapping is initialized with the given session.protected voidinitializeAttributeTransformer(org.eclipse.persistence.internal.sessions.AbstractSession databaseSession)INTERNAL: Convert the attribute transformer class name into an AttributeTransformer If the old-style method name in set, then use a MethodBasedAttributeTRansformerprotected voidinitializeFieldToTransformers(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Convert the field names and their corresponding method names to DatabaseFields and Methods.voidinstantiateAttribute(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Trigger the instantiation of the attribute if lazy.org.eclipse.persistence.internal.sessions.ChangeRecordinternalBuildChangeRecord(java.lang.Object clone, java.lang.Object oldValue, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Build a change record.java.lang.ObjectinvokeAttributeTransformer(org.eclipse.persistence.internal.sessions.AbstractRecord record, java.lang.Object domainObject, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Invoke the buildAttributeValue method on the AttributeTransformerprotected java.lang.ObjectinvokeFieldTransformer(org.eclipse.persistence.internal.helper.DatabaseField field, java.lang.Object domainObject, org.eclipse.persistence.internal.sessions.AbstractSession session)protected java.lang.ObjectinvokeFieldTransformer(org.eclipse.persistence.internal.helper.DatabaseField field, FieldTransformer transformer, java.lang.Object domainObject, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Invoke the buildFieldValue on the appropriate FieldTransformerbooleanisAttributeValueFromObjectInstantiated(java.lang.Object object)INTERNAL: Return whether the specified object is instantiated.booleanisChangeTrackingSupported(Project project)INTERNAL: Return if this mapping supports change tracking.booleanisMutable()PUBLIC: Return true if the attribute for this mapping is not a simple atomic value that cannot be modified, only replaced.booleanisReadOnly()INTERNAL: Return true if read-only is explicitly set to true; otherwise return whether the transformation has no fields (no fields = read-only)booleanisTransformationMapping()INTERNAL:booleanisWriteOnly()INTERNAL: Return if the transformation has no attribute, is write only.voiditerate(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator)INTERNAL: Perform the iteration opperation on the iterators current objects attributes.voiditerateOnRealAttributeValue(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator, java.lang.Object realAttributeValue)INTERNAL: Iterate on the attribute value.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.voidpreInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Allow for initialization of properties and validation.java.lang.ObjectreadFromReturnRowIntoObject(org.eclipse.persistence.internal.sessions.AbstractRecord row, java.lang.Object object, ReadObjectQuery query, java.util.Collection handledMappings, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet)INTERNAL: Extracts value from return row and set the attribute to the value in the object.java.lang.ObjectreadFromRowIntoObject(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, java.lang.Object object, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, ObjectBuildingQuery query, org.eclipse.persistence.internal.sessions.AbstractSession executionSession, boolean isTargetProtected)INTERNAL: Extract value from the row and set the attribute to the value in the object.voidremoteInitialization(DistributedSession session)INTERNAL: Once descriptors are serialized to the remote session.voidsetAttributeTransformation(java.lang.String methodName)PUBLIC: To set the attribute method name.voidsetAttributeTransformer(AttributeTransformer transformer)PUBLIC: Set the AttributeTransformer, this transformer will be used to extract the value for the object's attribute from the database row.voidsetAttributeTransformerClass(java.lang.Class attributeTransformerClass)INTERNAL: Set the attribute transformer's class.voidsetAttributeTransformerClassName(java.lang.String className)INTERNAL: Set the Attribute Transformer Class NamevoidsetAttributeValueInObject(java.lang.Object object, java.lang.Object value)INTERNAL: Check for write-only, one-way transformations.voidsetFieldNameToMethodNameAssociations(java.util.Vector associations)INTERNAL: needed for backwards compatibilityprotected voidsetFieldToTransformers(java.util.List<java.lang.Object[]> fieldToTransformers)voidsetFieldTransformations(java.util.List<org.eclipse.persistence.internal.descriptors.FieldTransformation> fieldTransformations)INTERNAL: Set the field to method name associations.voidsetIndirectionPolicy(org.eclipse.persistence.internal.indirection.IndirectionPolicy indirectionPolicy)ADVANCED: Set the indirection policy.voidsetIsMutable(boolean mutable)PUBLIC: Set if the value of the attribute is atomic or a complex mutable object and can be modified without replacing the entire object.voidsetRealAttributeValueInObject(java.lang.Object object, java.lang.Object value)INTERNAL: Set the value of the attribute mapped by this mapping, placing it inside a value holder if necessary.voidsetUsesIndirection(boolean usesIndirection)INTERNAL: Will be used by Gromit.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 the change record with the new value.voiduseBasicIndirection()PUBLIC: Indirection means that a ValueHolder will be put in-between the attribute and the real object.voiduseContainerIndirection(java.lang.Class containerClass)PUBLIC: Indirection means that a IndirectContainer (wrapping a ValueHolder) will be put in-between the attribute and the real object.voiduseIndirection()PUBLIC: Indirection means that a ValueHolder will be put in-between the attribute and the real object.booleanusesIndirection()PUBLIC: Indirection means that a ValueHolder will be put in-between the attribute and the real object.voidvalidateBeforeInitialization(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Validate mapping declarationjava.lang.ObjectvalueFromObject(java.lang.Object object, org.eclipse.persistence.internal.helper.DatabaseField field, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Get a value from the object and set that in the respective field of the row.voidwriteFromObjectIntoRow(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType)INTERNAL: Get a value from the object and set that in the respective field of the row.voidwriteFromObjectIntoRowForUpdate(WriteObjectQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord record)INTERNAL: Get a value from the object and set that in the respective field of the row.voidwriteFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType)INTERNAL: Get a value from the object and set that in the respective field of the row.voidwriteInsertFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord record, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Write fields needed for insert into the template for with null values.-
Methods inherited from class org.eclipse.persistence.mappings.DatabaseMapping
addUnconvertedProperty, buildContainerClone, buildExpression, buildObjectJoinExpression, buildObjectJoinExpression, calculateDeferredChanges, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemovePrivateOwnedObjectFromChangeSetIfRequired, cloneFields, collectQueryParameters, convertConverterClassNamesToClasses, derivesId, earlyPreDelete, extractNestedExpressions, extractNestedNonAggregateExpressions, fixRealObjectReferences, getAttributeAccessor, getAttributeClassification, getAttributeName, getContainerPolicy, getDerivedIdMapping, getDescriptor, getField, getFieldClassification, getFields, getGetMethodName, getMapsIdValue, getObjectCorrespondingTo, getOrderByNormalizedExpressions, getProperties, getProperty, getRealAttributeValueFromObject, getRealCollectionAttributeValueFromObject, getReferenceDescriptor, getRelationshipPartner, getSelectFields, getSelectTables, getSetMethodName, getUnconvertedProperties, getWeight, hasConstraintDependency, hasDependency, hasInverseConstraintDependency, hasMapsIdValue, hasNestedIdentityReference, hasRootExpressionThatShouldUseOuterJoin, hasUnconvertedProperties, isAbstractColumnMapping, isAbstractCompositeCollectionMapping, isAbstractCompositeDirectCollectionMapping, isAbstractCompositeObjectMapping, isAbstractDirectMapping, isAggregateCollectionMapping, isAggregateMapping, isAggregateObjectMapping, isCacheable, isCandidateForPrivateOwnedRemoval, isCascadedLockingSupported, isCloningRequired, isCollectionMapping, isDatabaseMapping, isDirectCollectionMapping, isDirectMapMapping, isDirectToFieldMapping, isDirectToXMLTypeMapping, isEISMapping, isElementCollectionMapping, isForeignReferenceMapping, isInAndOutSopObject, isInOnlySopObject, isInSopObject, isJoiningSupported, isJPAId, isLazy, isLockableMapping, isManyToManyMapping, isManyToOneMapping, isMapKeyMapping, isMultitenantPrimaryKeyMapping, isNestedTableMapping, isObjectReferenceMapping, isOneToManyMapping, isOneToOneMapping, isOptional, isOutOnlySopObject, isOutSopObject, isOwned, isPrimaryKeyMapping, isPrivateOwned, isReferenceMapping, isRelationalMapping, isRemotelyInitialized, isStructureMapping, isUnidirectionalOneToManyMapping, isUsingMethodAccess, isVariableOneToOneMapping, isXMLMapping, load, loadAll, performDataModificationEvent, postCalculateChanges, postCalculateChangesOnDeleted, postDelete, postInitialize, postInitializeSourceAndTargetExpressions, postInsert, postUpdate, preDelete, preInsert, prepareCascadeLockingPolicy, preUpdate, readFromResultSetIntoObject, readOnly, readWrite, recordPrivateOwnedRemovals, rehashFieldDependancies, remotelyInitialized, replaceValueHoldersIn, setAttributeAccessor, setAttributeName, setChangeListener, setDerivedIdMapping, setDerivesId, setDescriptor, setFields, setGetMethodName, setIsCacheable, setIsInAndOutSopObject, setIsInSopObject, setIsJPAId, setIsLazy, setIsMapKeyMapping, setIsOptional, setIsOutSopObject, setIsPrimaryKeyMapping, setIsReadOnly, setMapsIdValue, setProperties, setProperty, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord, toString, updateCollectionChangeRecord, validateAfterInitialization, valueFromResultSet, valueFromRow, valueFromRow, verifyDelete, writeFromAttributeIntoRow, writeFromObjectIntoRowForShallowInsert, writeFromObjectIntoRowForShallowInsertWithChangeRecord, writeFromObjectIntoRowForUpdateAfterShallowInsert, writeFromObjectIntoRowForUpdateBeforeShallowDelete, writeFromObjectIntoRowForWhereClause, writeUpdateFieldsIntoRow
-
-
-
-
Field Detail
-
attributeTransformerClassName
protected java.lang.String attributeTransformerClassName
Name of the class which implements AttributeTransformer to be used to retrieve the attribute value
-
attributeTransformer
protected AttributeTransformer attributeTransformer
attributeTransformerClassName is converter to an instance of AttributeTransformer
-
fieldTransformations
protected java.util.List<org.eclipse.persistence.internal.descriptors.FieldTransformation> fieldTransformations
Stores field name and the class name of a FieldTransformer in a vector to preserve order
-
fieldToTransformers
protected java.util.List<java.lang.Object[]> fieldToTransformers
The TransformerClassNames are converted into instances of FieldTransformer
-
isMutable
protected boolean isMutable
PERF: Indicates if this mapping's attribute is a simple value which cannot be modified only replaced.
-
indirectionPolicy
protected org.eclipse.persistence.internal.indirection.IndirectionPolicy indirectionPolicy
Implements indirection behaviour
-
-
Method Detail
-
addFieldTransformation
public void addFieldTransformation(org.eclipse.persistence.internal.helper.DatabaseField field, java.lang.String methodName)PUBLIC: Add the field and the name of the method that returns the value to be placed in said field when the object is written to the database. The method may take zero arguments, or it may take a single argument of typeorg.eclipse.persistence.sessions.Session.
-
addFieldTransformation
public void addFieldTransformation(java.lang.String fieldName, java.lang.String methodName)PUBLIC: Add the name of field and the name of the method that returns the value to be placed in said field when the object is written to the database. The method may take zero arguments, or it may take a single argument of typeorg.eclipse.persistence.sessions.Session.
-
addFieldTransformerClassName
public void addFieldTransformerClassName(java.lang.String fieldName, java.lang.String className)INTERNAL: Add the name of a field and the name of a class which implements the FieldTransformer interface. When the object is written, the transform method will be called on the FieldTransformer to acquire the value to put in the field.
-
addFieldTransformerClassName
public void addFieldTransformerClassName(org.eclipse.persistence.internal.helper.DatabaseField field, java.lang.String className)INTERNAL: Add the name of a field and the name of a class which implements the FieldTransformer interface. When the object is written, the transform method will be called on the FieldTransformer to acquire the value to put in the field.
-
addFieldTransformer
public void addFieldTransformer(java.lang.String fieldName, FieldTransformer transformer)PUBLIC: Add the name of field and the transformer that returns the value to be placed in the field when the object is written to the database.
-
addFieldTransformer
public void addFieldTransformer(org.eclipse.persistence.internal.helper.DatabaseField field, FieldTransformer transformer)PUBLIC: Add the field and the transformer that returns the value to be placed in the field when the object is written to the database.
-
areObjectsToBeProcessedInstantiated
protected boolean areObjectsToBeProcessedInstantiated(java.lang.Object object)
INTERNAL: The referenced object is checked if it is instantiated or not
-
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.- Specified by:
buildBackupClonein classDatabaseMapping
-
buildPhantomRowFrom
protected org.eclipse.persistence.internal.sessions.AbstractRecord buildPhantomRowFrom(java.lang.Object domainObject, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL Build a phantom row that contains only the fields for the mapping, populated with the values generated by invoking the field methods on the specified object.
-
buildShallowOriginalFromRow
public void buildShallowOriginalFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord record, java.lang.Object original, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, ObjectBuildingQuery query, org.eclipse.persistence.internal.sessions.AbstractSession executionSession)INTERNAL: Builds a shallow original object. Only direct attributes and primary keys are populated. In this way the minimum original required for instantiating a working copy clone can be built without placing it in the shared cache (no concern over cycles).- Overrides:
buildShallowOriginalFromRowin classDatabaseMapping- Parameters:
original- later the input to buildCloneFromRow
-
buildBackupCloneForPartObject
public java.lang.Object buildBackupCloneForPartObject(java.lang.Object attributeValue, java.lang.Object clone, java.lang.Object backup, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork)INTERNAL: Used during building the backup shallow copy to copy the vector without re-registering the target objects. For 1-1 or ref the reference is from the clone so it is already registered.- Overrides:
buildBackupCloneForPartObjectin classDatabaseMapping
-
buildClone
public void buildClone(java.lang.Object original, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, java.lang.Object clone, java.lang.Integer refreshCascade, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession)INTERNAL: Clone the attribute from the original and assign it to the clone.- Specified by:
buildClonein classDatabaseMapping
-
buildCloneFromRow
public void buildCloneFromRow(org.eclipse.persistence.internal.sessions.AbstractRecord record, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, java.lang.Object clone, org.eclipse.persistence.internal.identitymaps.CacheKey sharedCacheKey, ObjectBuildingQuery sourceQuery, org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.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:
buildCloneFromRowin classDatabaseMapping
-
buildCloneForPartObject
public java.lang.Object buildCloneForPartObject(java.lang.Object attributeValue, java.lang.Object original, org.eclipse.persistence.internal.identitymaps.CacheKey cacheKey, java.lang.Object clone, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession, java.lang.Integer refreshCascade, boolean isExisting, boolean isFromSharedCache)INTERNAL: Require for cloning, the part must be cloned. Ignore the attribute value, go right to the object itself.- Overrides:
buildCloneForPartObjectin classDatabaseMapping
-
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 classDatabaseMapping
-
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- Specified by:
cascadePerformRemoveIfRequiredin classDatabaseMapping
-
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- Specified by:
cascadeRegisterNewIfRequiredin classDatabaseMapping
-
clone
public java.lang.Object clone()
INTERNAL: The mapping clones itself to create deep copy.- Overrides:
clonein classDatabaseMapping
-
collectFields
protected java.util.Vector collectFields()
INTERNAL: Return all the fields with this mapping.- Overrides:
collectFieldsin classDatabaseMapping
-
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 attributes belonging to this mapping for the objects.- Specified by:
compareForChangein classDatabaseMapping- Returns:
- prototype.changeset.ChangeRecord
-
buildChangeRecord
public org.eclipse.persistence.internal.sessions.ChangeRecord buildChangeRecord(java.lang.Object clone, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Directly build a change record without comparison- Overrides:
buildChangeRecordin classDatabaseMapping
-
internalBuildChangeRecord
public org.eclipse.persistence.internal.sessions.ChangeRecord internalBuildChangeRecord(java.lang.Object clone, java.lang.Object oldValue, org.eclipse.persistence.internal.sessions.ObjectChangeSet owner, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Build a change record.
-
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.- Specified by:
compareObjectsin classDatabaseMapping
-
convertClassNamesToClasses
public void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this mapping to actual class-based settings- Overrides:
convertClassNamesToClassesin classDatabaseMapping- Parameters:
classLoader-
-
createCloneValueHolder
public org.eclipse.persistence.internal.indirection.DatabaseValueHolder createCloneValueHolder(ValueHolderInterface attributeValue, java.lang.Object original, java.lang.Object clone, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession cloningSession, boolean buildDirectlyFromRow)
INTERNAL: Builder the unit of work value holder. Ignore the original object.- Overrides:
createCloneValueHolderin classDatabaseMapping- Parameters:
buildDirectlyFromRow- indicates that we are building the clone directly from a row as opposed to building the original from the row, putting it in the shared cache, and then cloning the original.
-
dontUseIndirection
public void dontUseIndirection()
PUBLIC: Indirection means that a ValueHolder will be put in-between the attribute and the real object. This defaults to false and only required for transformations that perform database access.
-
fixObjectReferences
public void fixObjectReferences(java.lang.Object object, java.util.Map objectDescriptors, java.util.Map processedObjects, ObjectLevelReadQuery query, DistributedSession session)INTERNAL: An object has been serialized from the server to the client. Replace the transient attributes of the remote value holders with client-side objects.- Specified by:
fixObjectReferencesin classDatabaseMapping
-
getAttributeTransformer
public AttributeTransformer getAttributeTransformer()
INTERNAL: The attributeTransformer stores an instance of the class which implements AttributeTransformer.
-
getAttributeMethodName
public java.lang.String getAttributeMethodName()
PUBLIC: Return the attribute transformation method name.
-
getAttributeTransformerClass
public java.lang.Class getAttributeTransformerClass()
INTERNAL: Return the attribute transformer's class. This is used to map to XML.
-
setAttributeTransformerClass
public void setAttributeTransformerClass(java.lang.Class attributeTransformerClass)
INTERNAL: Set the attribute transformer's class. This is used to map from XML.
-
getAttributeTransformerClassName
public java.lang.String getAttributeTransformerClassName()
INTERNAL: Return the attribute transformer class name
-
getAttributeValueFromObject
public java.lang.Object getAttributeValueFromObject(java.lang.Object object) throws DescriptorExceptionINTERNAL: Check for write-only, one-way transformation.- Overrides:
getAttributeValueFromObjectin classDatabaseMapping- Throws:
DescriptorException
-
getFieldTransformations
public java.util.List<org.eclipse.persistence.internal.descriptors.FieldTransformation> getFieldTransformations()
INTERNAL: Returns a Vector which stores fieldnames and the respective method/transformer names.
-
getFieldToTransformers
public java.util.List<java.lang.Object[]> getFieldToTransformers()
INTERNAL:- Returns:
- a vector which stores fields and their respective transformers.
-
getIndirectionPolicy
public org.eclipse.persistence.internal.indirection.IndirectionPolicy getIndirectionPolicy()
INTERNAL: Return the mapping's indirection policy.
-
getRealAttributeValueFromAttribute
public java.lang.Object getRealAttributeValueFromAttribute(java.lang.Object attributeValue, java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Returns the real attribute value from the reference object's attribute value. If the attribute is using indirection the value of the value-holder is returned. If the value holder is not instantiated then it is instantiated.- Overrides:
getRealAttributeValueFromAttributein classDatabaseMapping
-
instantiateAttribute
public void instantiateAttribute(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Trigger the instantiation of the attribute if lazy.- Overrides:
instantiateAttributein classDatabaseMapping
-
getValueFromRemoteValueHolder
public java.lang.Object getValueFromRemoteValueHolder(org.eclipse.persistence.internal.sessions.remote.RemoteValueHolder remoteValueHolder)
INTERNAL: Extract and return the appropriate value from the specified remote value holder.- Overrides:
getValueFromRemoteValueHolderin classDatabaseMapping
-
initialize
public void initialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorExceptionINTERNAL: The mapping is initialized with the given session.- Overrides:
initializein classDatabaseMapping- Throws:
DescriptorException
-
initializeAttributeTransformer
protected void initializeAttributeTransformer(org.eclipse.persistence.internal.sessions.AbstractSession databaseSession) throws DescriptorExceptionINTERNAL: Convert the attribute transformer class name into an AttributeTransformer If the old-style method name in set, then use a MethodBasedAttributeTRansformer- Throws:
DescriptorException
-
getFieldNameToMethodNames
public java.util.Hashtable getFieldNameToMethodNames()
INTERNAL: Required for reverse compatibility and test cases:- Returns:
- a hash table containing the fieldName and their respective method names
-
initializeFieldToTransformers
protected void initializeFieldToTransformers(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorExceptionINTERNAL: Convert the field names and their corresponding method names to DatabaseFields and Methods.- Throws:
DescriptorException
-
invokeAttributeTransformer
public java.lang.Object invokeAttributeTransformer(org.eclipse.persistence.internal.sessions.AbstractRecord record, java.lang.Object domainObject, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorExceptionINTERNAL: Invoke the buildAttributeValue method on the AttributeTransformer- Throws:
DescriptorException
-
invokeFieldTransformer
protected java.lang.Object invokeFieldTransformer(org.eclipse.persistence.internal.helper.DatabaseField field, FieldTransformer transformer, java.lang.Object domainObject, org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorExceptionINTERNAL: Invoke the buildFieldValue on the appropriate FieldTransformer- Throws:
DescriptorException
-
invokeFieldTransformer
protected java.lang.Object invokeFieldTransformer(org.eclipse.persistence.internal.helper.DatabaseField field, java.lang.Object domainObject, org.eclipse.persistence.internal.sessions.AbstractSession session)
-
isMutable
public boolean isMutable()
PUBLIC: Return true if the attribute for this mapping is not a simple atomic value that cannot be modified, only replaced. This is true by default for non-primitives, but can be set to false to avoid cloning and change comparison in the unit of work.
-
isReadOnly
public boolean isReadOnly()
INTERNAL: Return true if read-only is explicitly set to true; otherwise return whether the transformation has no fields (no fields = read-only)- Overrides:
isReadOnlyin classDatabaseMapping
-
isTransformationMapping
public boolean isTransformationMapping()
INTERNAL:- Overrides:
isTransformationMappingin classDatabaseMapping
-
isWriteOnly
public boolean isWriteOnly()
INTERNAL: Return if the transformation has no attribute, is write only.- Overrides:
isWriteOnlyin classDatabaseMapping
-
iterate
public void iterate(org.eclipse.persistence.internal.descriptors.DescriptorIterator iterator)
INTERNAL: Perform the iteration opperation on the iterators current objects attributes. Only require if primitives are desired.- Specified by:
iteratein 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.- Overrides:
iterateOnRealAttributeValuein classDatabaseMapping
-
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. Which is the original from the parent UnitOfWork- Specified by:
mergeChangesIntoObjectin classDatabaseMapping
-
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.- Specified by:
mergeIntoObjectin classDatabaseMapping
-
preInitialize
public void preInitialize(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorExceptionINTERNAL: Allow for initialization of properties and validation.- Overrides:
preInitializein classDatabaseMapping- Throws:
DescriptorException
-
readFromReturnRowIntoObject
public java.lang.Object readFromReturnRowIntoObject(org.eclipse.persistence.internal.sessions.AbstractRecord row, java.lang.Object object, ReadObjectQuery query, java.util.Collection handledMappings, org.eclipse.persistence.internal.sessions.ObjectChangeSet changeSet) throws DatabaseExceptionINTERNAL: Extracts value from return row and set the attribute to the value in the object. Return row is merged into object after execution of insert or update call according to ReturningPolicy.- Throws:
DatabaseException
-
readFromRowIntoObject
public java.lang.Object readFromRowIntoObject(org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.queries.JoinedAttributeManager joinManager, java.lang.Object object, org.eclipse.persistence.internal.identitymaps.CacheKey parentCacheKey, ObjectBuildingQuery query, org.eclipse.persistence.internal.sessions.AbstractSession executionSession, boolean isTargetProtected) throws DatabaseExceptionINTERNAL: Extract value from the row and set the attribute to the value in the object.- Overrides:
readFromRowIntoObjectin classDatabaseMapping- Throws:
DatabaseException
-
getFieldNameToMethodNameAssociations
public java.util.Vector getFieldNameToMethodNameAssociations()
INTERNAL: Needed for backwards compatibility
-
setFieldNameToMethodNameAssociations
public void setFieldNameToMethodNameAssociations(java.util.Vector associations)
INTERNAL: needed for backwards compatibility
-
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 classDatabaseMapping
-
setAttributeTransformer
public void setAttributeTransformer(AttributeTransformer transformer)
PUBLIC: Set the AttributeTransformer, this transformer will be used to extract the value for the object's attribute from the database row.
-
setAttributeTransformerClassName
public void setAttributeTransformerClassName(java.lang.String className)
INTERNAL: Set the Attribute Transformer Class Name- Parameters:
className-
-
setAttributeTransformation
public void setAttributeTransformation(java.lang.String methodName)
PUBLIC: To set the attribute method name. The method is invoked internally by TopLink to retrieve the value to store in the domain object. The method receives Record as its parameter and optionally Session, and should extract the value from the record to set into the object, but should not set the value on the object, only return it.
-
setAttributeValueInObject
public void setAttributeValueInObject(java.lang.Object object, java.lang.Object value)INTERNAL: Check for write-only, one-way transformations.- Overrides:
setAttributeValueInObjectin classDatabaseMapping
-
setIsMutable
public void setIsMutable(boolean mutable)
PUBLIC: Set if the value of the attribute is atomic or a complex mutable object and can be modified without replacing the entire object. This defaults to true for non-primitives, but can be set to false to optimize object cloning and change comparison.
-
setRealAttributeValueInObject
public void setRealAttributeValueInObject(java.lang.Object object, java.lang.Object value) throws DescriptorExceptionINTERNAL: Set the value of the attribute mapped by this mapping, placing it inside a value holder if necessary. If the value holder is not instantiated then it is instantiated. Check for write-only, one-way transformations.- Overrides:
setRealAttributeValueInObjectin classDatabaseMapping- Throws:
DescriptorException
-
setFieldTransformations
public void setFieldTransformations(java.util.List<org.eclipse.persistence.internal.descriptors.FieldTransformation> fieldTransformations)
INTERNAL: Set the field to method name associations.
-
setFieldToTransformers
protected void setFieldToTransformers(java.util.List<java.lang.Object[]> fieldToTransformers)
-
setIndirectionPolicy
public void setIndirectionPolicy(org.eclipse.persistence.internal.indirection.IndirectionPolicy indirectionPolicy)
ADVANCED: Set the indirection policy.
-
setUsesIndirection
public void setUsesIndirection(boolean usesIndirection)
INTERNAL: Will be used by Gromit. For details see usesIndirection().- See Also:
useBasicIndirection(),dontUseIndirection()
-
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 the change record with the new value. This is used by attribute change tracking.- Overrides:
updateChangeRecordin classDatabaseMapping
-
isChangeTrackingSupported
public boolean isChangeTrackingSupported(Project project)
INTERNAL: Return if this mapping supports change tracking.- Overrides:
isChangeTrackingSupportedin classDatabaseMapping
-
isAttributeValueFromObjectInstantiated
public boolean isAttributeValueFromObjectInstantiated(java.lang.Object object)
INTERNAL: Return whether the specified object is instantiated.- Overrides:
isAttributeValueFromObjectInstantiatedin classDatabaseMapping
-
useBasicIndirection
public void useBasicIndirection()
PUBLIC: Indirection means that a ValueHolder will be put in-between the attribute and the real object. This defaults to false and only required for transformations that perform database access.
-
useContainerIndirection
public void useContainerIndirection(java.lang.Class containerClass)
PUBLIC: Indirection means that a IndirectContainer (wrapping a ValueHolder) will be put in-between the attribute and the real object. This allows for the reading of the target from the database to be delayed until accessed. This defaults to true and is strongly suggested as it give a huge performance gain.
-
useIndirection
public void useIndirection()
PUBLIC: Indirection means that a ValueHolder will be put in-between the attribute and the real object. This defaults to false and only required for transformations that perform database access.- See Also:
useBasicIndirection()
-
usesIndirection
public boolean usesIndirection()
PUBLIC: Indirection means that a ValueHolder will be put in-between the attribute and the real object. This defaults to false and only required for transformations that perform database access.- See Also:
IndirectionPolicy
-
validateBeforeInitialization
public void validateBeforeInitialization(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DescriptorExceptionINTERNAL: Validate mapping declaration- Overrides:
validateBeforeInitializationin classDatabaseMapping- Throws:
DescriptorException
-
valueFromObject
public java.lang.Object valueFromObject(java.lang.Object object, org.eclipse.persistence.internal.helper.DatabaseField field, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Get a value from the object and set that in the respective field of the row.- Overrides:
valueFromObjectin classDatabaseMapping
-
writeFromObjectIntoRow
public void writeFromObjectIntoRow(java.lang.Object object, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType)INTERNAL: Get a value from the object and set that in the respective field of the row.- Overrides:
writeFromObjectIntoRowin classDatabaseMapping
-
writeFromObjectIntoRowWithChangeRecord
public void writeFromObjectIntoRowWithChangeRecord(org.eclipse.persistence.internal.sessions.ChangeRecord changeRecord, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.internal.sessions.AbstractSession session, DatabaseMapping.WriteType writeType)INTERNAL: Get a value from the object and set that in the respective field of the row.- Overrides:
writeFromObjectIntoRowWithChangeRecordin classDatabaseMapping
-
writeFromObjectIntoRowForUpdate
public void writeFromObjectIntoRowForUpdate(WriteObjectQuery query, org.eclipse.persistence.internal.sessions.AbstractRecord record)
INTERNAL: Get a value from the object and set that in the respective field of the row. But before that check if the reference object is instantiated or not.- Overrides:
writeFromObjectIntoRowForUpdatein classDatabaseMapping
-
writeInsertFieldsIntoRow
public void writeInsertFieldsIntoRow(org.eclipse.persistence.internal.sessions.AbstractRecord record, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Write fields needed for insert into the template for with null values.- Overrides:
writeInsertFieldsIntoRowin classDatabaseMapping
-
-