Oracle Application Server TopLink API Reference
10g Release 2 (10.1.2)

B15903-01


oracle.toplink.mappings
Class TransformationMapping

java.lang.Object
  extended byoracle.toplink.mappings.DatabaseMapping
      extended byoracle.toplink.mappings.TransformationMapping

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

public class TransformationMapping
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
TransformationMapping()
PUBLIC: Default constructor.

Method Summary
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.
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.
java.util.Vector getFieldNameToMethodNameAssociations()
PUBLIC: Return a collection of the field name to method name associations.
void setAttributeMethodName(java.lang.String aMethodName)
PUBLIC: To set the method name.
void setAttributeTransformation(java.lang.String methodName)
PUBLIC: To set the attribute method name.
void setFieldNameToMethodNameAssociations(java.util.Vector fieldAssociations)
PUBLIC: Set the field to method name associations.
void setIndirectionPolicy(oracle.toplink.internal.indirection.IndirectionPolicy indirectionPolicy)
ADVANCED: Set the indirection policy.
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 means that a ValueHolder will be put in-between the attribute and the real object.

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

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

Constructor Detail

TransformationMapping

public TransformationMapping()
PUBLIC: Default constructor.

Method Detail

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 oracle.toplink.publicinterface.Session.

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.

getFieldNameToMethodNameAssociations

public java.util.Vector getFieldNameToMethodNameAssociations()
PUBLIC: Return a collection of the field name to method name associations.

setAttributeMethodName

public void setAttributeMethodName(java.lang.String aMethodName)
PUBLIC: To set the 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 value to store in the domain object. The method receives databaseRow as its parameter and optionally session.

setFieldNameToMethodNameAssociations

public void setFieldNameToMethodNameAssociations(java.util.Vector fieldAssociations)
PUBLIC: Set the field to method name associations.

setIndirectionPolicy

public void setIndirectionPolicy(oracle.toplink.internal.indirection.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 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:
oracle.toplink.mappings.IndirectionPolicy

Copyright © 1998, 2005 Oracle Corporation. All Rights Reserved.