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.converters
Class ObjectTypeConverter

`java.lang.Object
oracle.toplink.mappings.converters.ObjectTypeConverter`

All Implemented Interfaces:
  Converter, java.io.Serializable

public class ObjectTypeConverter
extends java.lang.Object
implements Converter

Purpose: Object type converter is used to match a fixed number of database data values to Java object value. It can be used when the values on the database and in the Java differ. To create an object type converter, simply specify the set of conversion value pairs. A default value and one-way conversion are also supported for legacy data situations.

Since:
  Toplink 10
See Also:
  Serialized Form

Constructor Summary
`ObjectTypeConverter()` PUBLIC: Default constructor.
`ObjectTypeConverter(DatabaseMapping mapping)` PUBLIC: Default constructor.

Method Summary
`void` | `addConversionValue(java.lang.Object fieldValue, java.lang.Object attributeValue)` PUBLIC: A type conversion value is a two-way mapping from the database to the object.
`void` | `addToAttributeOnlyConversionValue(java.lang.Object fieldValue, java.lang.Object attributeValue)` PUBLIC: An attribute only conversion value is a one-way mapping from the database to the object.
`java.lang.Object` | `getDefaultAttributeValue()` PUBLIC: The default value can be used if the database can possibly store additional values then those that have been mapped.
`java.lang.String` | `getFieldClassificationName()`
`void` | `mapBooleans()` PUBLIC: This is a very specific protocol which maps fieldValues "T" and "F" to true and false respectively.
`void` | `mapGenders()` PUBLIC: This is a very specific protocol which maps fieldValues "F" and "M" to "Female" and "Male" respectively.
`void` | `mapResponses()` PUBLIC: This is a very specific protocol which maps fieldValues "Y" and "N" to "Yes" and "No" respectively.
`void` | `setDefaultAttributeValue(java.lang.Object defaultAttributeValue)` PUBLIC: The default value can be used if the database can possibly store additional values then those that have been mapped.
`void` | `setFieldClassificationName(java.lang.String fieldClassificationName)`

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

Constructor Detail

### ObjectTypeConverter

    public ObjectTypeConverter()

  PUBLIC: Default constructor.

### ObjectTypeConverter

    public ObjectTypeConverter(DatabaseMapping mapping)

  PUBLIC: Default constructor.

Method Detail

### addConversionValue

    public void addConversionValue(java.lang.Object fieldValue,
                                   java.lang.Object attributeValue)

  PUBLIC: A type conversion value is a two-way mapping from the database to the object. The database value will be substituted for the object value when read, and the object value will be substituted for database value when written. Note that each field/attribute value must have one and only one attribute/field value to maintain a two-way mapping.

### addToAttributeOnlyConversionValue

    public void addToAttributeOnlyConversionValue(java.lang.Object fieldValue,
                                                  java.lang.Object attributeValue)

  PUBLIC: An attribute only conversion value is a one-way mapping from the database to the object. This can be used if multiple database values are desired to be mapped to the same object value. Note that when written only the default value will be used for the attribute, not this value.

### getDefaultAttributeValue

    public java.lang.Object getDefaultAttributeValue()

  PUBLIC: The default value can be used if the database can possibly store additional values then those that have been mapped. Any value retreived from the database that is not mapped will be substitued for the default value.

### getFieldClassificationName

    public java.lang.String getFieldClassificationName()

### mapBooleans

    public void mapBooleans()

  PUBLIC: This is a very specific protocol which maps fieldValues "T" and "F" to true and false respectively.

### mapGenders

    public void mapGenders()

  PUBLIC: This is a very specific protocol which maps fieldValues "F" and "M" to "Female" and "Male" respectively.

### mapResponses

    public void mapResponses()

  PUBLIC: This is a very specific protocol which maps fieldValues "Y" and "N" to "Yes" and "No" respectively.

### setDefaultAttributeValue

    public void setDefaultAttributeValue(java.lang.Object defaultAttributeValue)

  PUBLIC: The default value can be used if the database can possibly store additional values then those that have been mapped. Any value retreived from the database that is not mapped will be substitued for the default value.

### setFieldClassificationName

    public void setFieldClassificationName(java.lang.String fieldClassificationName)

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