Class 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
    • 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
    • Constructor Detail

      • AbstractTransformationMapping

        public AbstractTransformationMapping()
        PUBLIC: Default constructor.
    • 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 type org.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 type org.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:
        buildBackupClone in class DatabaseMapping
      • 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:
        buildShallowOriginalFromRow in class DatabaseMapping
        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:
        buildBackupCloneForPartObject in class DatabaseMapping
      • 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:
        buildClone in class DatabaseMapping
      • 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:
        buildCloneFromRow in class DatabaseMapping
      • 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:
        buildCloneForPartObject in class DatabaseMapping
      • 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:
        buildCopy in class DatabaseMapping
      • 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:
        cascadePerformRemoveIfRequired in class DatabaseMapping
      • 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:
        cascadeRegisterNewIfRequired in class DatabaseMapping
      • clone

        public java.lang.Object clone()
        INTERNAL: The mapping clones itself to create deep copy.
        Overrides:
        clone in class DatabaseMapping
      • collectFields

        protected java.util.Vector collectFields()
        INTERNAL: Return all the fields with this mapping.
        Overrides:
        collectFields 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 attributes belonging to this mapping for the objects.
        Specified by:
        compareForChange in class DatabaseMapping
        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:
        buildChangeRecord in class DatabaseMapping
      • 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:
        compareObjects in class DatabaseMapping
      • 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:
        convertClassNamesToClasses in class DatabaseMapping
        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:
        createCloneValueHolder in class DatabaseMapping
        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:
        fixObjectReferences in class DatabaseMapping
      • 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
      • 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:
        getRealAttributeValueFromAttribute in class DatabaseMapping
      • 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:
        instantiateAttribute in class DatabaseMapping
      • 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:
        getValueFromRemoteValueHolder in class DatabaseMapping
      • initializeAttributeTransformer

        protected void initializeAttributeTransformer​(org.eclipse.persistence.internal.sessions.AbstractSession databaseSession)
                                               throws DescriptorException
        INTERNAL: 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 DescriptorException
        INTERNAL: 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 DescriptorException
        INTERNAL: 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 DescriptorException
        INTERNAL: 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:
        isReadOnly in class DatabaseMapping
      • isWriteOnly

        public boolean isWriteOnly()
        INTERNAL: Return if the transformation has no attribute, is write only.
        Overrides:
        isWriteOnly in class DatabaseMapping
      • 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:
        iterate in class DatabaseMapping
      • 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:
        iterateOnRealAttributeValue 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. Which is the original from the parent UnitOfWork
        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.
        Specified by:
        mergeIntoObject in class DatabaseMapping
      • 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 DatabaseException
        INTERNAL: 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 DatabaseException
        INTERNAL: Extract value from the row and set the attribute to the value in the object.
        Overrides:
        readFromRowIntoObject in class DatabaseMapping
        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:
        remoteInitialization in class DatabaseMapping
      • 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:
        setAttributeValueInObject in class DatabaseMapping
      • 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 DescriptorException
        INTERNAL: 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:
        setRealAttributeValueInObject in class DatabaseMapping
        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:
        updateChangeRecord in class DatabaseMapping
      • isAttributeValueFromObjectInstantiated

        public boolean isAttributeValueFromObjectInstantiated​(java.lang.Object object)
        INTERNAL: Return whether the specified object is instantiated.
        Overrides:
        isAttributeValueFromObjectInstantiated in class DatabaseMapping
      • 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
      • 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:
        valueFromObject in class DatabaseMapping
      • 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:
        writeFromObjectIntoRow in class DatabaseMapping
      • 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:
        writeFromObjectIntoRowWithChangeRecord in class DatabaseMapping
      • 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:
        writeFromObjectIntoRowForUpdate in class DatabaseMapping
      • 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:
        writeInsertFieldsIntoRow in class DatabaseMapping