Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle TopLink API Reference 10g Release 3 (10.1.3) B13698-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.toplink.mappings.foundation
Class AbstractTransformationMapping

`java.lang.Object
oracle.toplink.mappings.DatabaseMapping
oracle.toplink.mappings.foundation.AbstractTransformationMapping`

All Implemented Interfaces:
  java.lang.Cloneable, java.io.Serializable

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.

Since:
  TOPLink/Java 1.0
See Also:
  Serialized Form

Constructor Summary
`AbstractTransformationMapping()` PUBLIC: Default constructor.

Method Summary
`void` | `addFieldTransformation(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.
`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.
`void` | `dontUseIndirection()` PUBLIC: Indirection means that a ValueHolder will be put in-between the attribute and the real object.
`java.lang.String` | `getAttributeMethodName()` PUBLIC: Return the attribute transformation method name.
`boolean` | `isMutable()` PUBLIC: Return true if the attribute for this mapping is not a simple atomic value that cannot be modified, only replaced.
`void` | `setAttributeMethodName(java.lang.String aMethodName)` Deprecated. replaced by setAttributeTransformation(String)
`void` | `setAttributeTransformation(java.lang.String methodName)` PUBLIC: To set the attribute method name.
`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.
`void` | `setIndirectionPolicy(IndirectionPolicy indirectionPolicy)` ADVANCED: Set the indirection policy.
`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.
`void` | `useBasicIndirection()` PUBLIC: Indirection means that a ValueHolder will be put in-between the attribute and the real object.
`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.
`void` | `useIndirection()` PUBLIC: Indirection means that a ValueHolder will be put in-between the attribute and the real object.
`boolean` | `usesIndirection()` PUBLIC: Indirection meansthat a ValueHolder will be put in-between the attribute and the real object.

Methods inherited from class oracle.toplink.mappings.DatabaseMapping
`getAttributeAccessor, getAttributeClassification, getAttributeName, getGetMethodName, getReferenceClassDescriptor, getSetMethodName, isUsingMethodAccess, readOnly, readWrite, setAttributeAccessor, setAttributeName, setGetMethodName, setIsReadOnly, setSetMethodName, setWeight, simpleAddToCollectionChangeRecord, simpleRemoveFromCollectionChangeRecord`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### AbstractTransformationMapping

    public AbstractTransformationMapping()

  PUBLIC: Default constructor.

Method Detail

### addFieldTransformation

    public void addFieldTransformation(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 `oracle.toplink.sessions.Session`.

### 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.

### 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.

### getAttributeMethodName

    public java.lang.String getAttributeMethodName()

  PUBLIC: Return the attribute transformation method name.

### 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.

### 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.

### setAttributeMethodName

    public void setAttributeMethodName(java.lang.String aMethodName)

  Deprecated. replaced by setAttributeTransformation(String)
  PUBLIC: To set the attribute transformation method name.

### setAttributeTransformation

    public void setAttributeTransformation(java.lang.String methodName)

  PUBLIC: To set the attribute method name. The method is invoked internally by TopLink to retreive 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.

### 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.

### setIndirectionPolicy

    public void setIndirectionPolicy(IndirectionPolicy indirectionPolicy)

  ADVANCED: Set the indirection policy.

### 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 meansthat 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:
    `oracle.toplink.mappings.IndirectionPolicy`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 1998, 2006, Oracle. All Rights Reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD