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 AbstractDirectMapping

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

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

Direct Known Subclasses:
  DirectToFieldMapping, EISDirectMapping, XMLDirectMapping

public abstract class AbstractDirectMapping
extends DatabaseMapping

Purpose: Maps an attribute to the corresponding database field type. The list of field types that are supported by TopLink's direct to field mapping is dependent on the relational database being used. A converter can be used to convert between the object and data type if they do not match.

Since:
  TopLink/Java 1.0
See Also:
  `Converter`, `ObjectTypeConverter`, `TypeConversionConverter`, `SerializedObjectConverter`, Serialized Form

Constructor Summary
`AbstractDirectMapping()` Default constructor.

Method Summary
`java.lang.Class` | `getAttributeClassification()` PUBLIC: Some databases do not properly support all of the base data types.
`java.lang.String` | `getAttributeClassificationName()`
`Converter` | `getConverter()` PUBLIC: Return the converter on the mapping.
`java.lang.Class` | `getFieldClassification()` ADVANCED: Return the class type of the field value.
`java.lang.String` | `getFieldName()` PUBLIC: Name of the field this mapping represents.
`java.lang.Object` | `getNullValue()` PUBLIC: Allow for the value used for null to be specified.
`boolean` | `isMutable()` PUBLIC: Return true if the attribute for this mapping is a simple atomic value that cannot be modified, only replaced.
`void` | `setAttributeClassification(java.lang.Class attributeClassification)` PUBLIC: Some databases do not properly support all of the base data types.
`void` | `setConverter(Converter converter)` PUBLIC: Set the converter on the mapping.
`void` | `setField(DatabaseField theField)` ADVANCED: Set the field in the mapping.
`void` | `setFieldClassification(java.lang.Class fieldType)` ADVANCED: Set the class type of the field value.
`void` | `setFieldType(int jdbcType)` ADVANCED: Set the JDBC type of the field value.
`void` | `setIsMutable(boolean isMutable)` PUBLIC: Return true if the attribute for this mapping is a simple atomic value that cannot be modified, only replaced.
`void` | `setNullValue(java.lang.Object nullValue)` PUBLIC: Allow for the value used for null to be specified.

Methods inherited from class oracle.toplink.mappings.DatabaseMapping
`getAttributeAccessor, 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

### AbstractDirectMapping

    public AbstractDirectMapping()

  Default constructor.

Method Detail

### getConverter

    public Converter getConverter()

  PUBLIC: Return the converter on the mapping. A converter can be used to convert between the object's value and database value of the attribute.

### setConverter

    public void setConverter(Converter converter)

  PUBLIC: Set the converter on the mapping. A converter can be used to convert between the object's value and database value of the attribute.

### isMutable

    public boolean isMutable()

  PUBLIC: Return true if the attribute for this mapping is a simple atomic value that cannot be modified, only replaced. This is false by default unless a mutable converter is used such as the SerializedObjectConverter. This can be set to false in this case, or if a Calendar or byte[] is desired to be used as a mutable value it can be set to true.

### setIsMutable

    public void setIsMutable(boolean isMutable)

  PUBLIC: Return true if the attribute for this mapping is a simple atomic value that cannot be modified, only replaced. This is false by default unless a mutable converter is used such as the SerializedObjectConverter. This can be set to false in this case, or if a Calendar or byte[] is desired to be used as a mutable value it can be set to true.

### getAttributeClassification

    public java.lang.Class getAttributeClassification()

  PUBLIC: Some databases do not properly support all of the base data types. For these databases, the base data type must be explicitly specified in the mapping to tell TopLink to force the instance variable value to that data type
  Overrides:
    `getAttributeClassification` in class `DatabaseMapping`

### getAttributeClassificationName

    public java.lang.String getAttributeClassificationName()

### getFieldClassification

    public java.lang.Class getFieldClassification()

  ADVANCED: Return the class type of the field value. This can be used if field value differs from the object value, has specific typing requirements such as usage of java.sql.Blob or NChar.

### setFieldClassification

    public void setFieldClassification(java.lang.Class fieldType)

  ADVANCED: Set the class type of the field value. This can be used if field value differs from the object value, has specific typing requirements such as usage of java.sql.Blob or NChar. This must be called after the field name has been set.

### setFieldType

    public void setFieldType(int jdbcType)

  ADVANCED: Set the JDBC type of the field value. This can be used if field type does not corespond directly to a Java class type, such as MONEY. This is used for binding.

### getFieldName

    public java.lang.String getFieldName()

  PUBLIC: Name of the field this mapping represents.

### getNullValue

    public java.lang.Object getNullValue()

  PUBLIC: Allow for the value used for null to be specified. This can be used to convert database null values to application specific values, when null values are not allowed by the application (such as in primitives). Note: the default value for NULL is used on reads, writes, and query SQL generation

### setAttributeClassification

    public void setAttributeClassification(java.lang.Class attributeClassification)

  PUBLIC: Some databases do not properly support all of the base data types. For these databases, the base data type must be explicitly specified in the mapping to tell TopLink to force the instance variable value to that data type

### setField

    public void setField(DatabaseField theField)

  ADVANCED: Set the field in the mapping. This can be used for advanced field types, such as XML nodes, or to set the field type.

### setNullValue

    public void setNullValue(java.lang.Object nullValue)

  PUBLIC: Allow for the value used for null to be specified. This can be used to convert database null values to application specific values, when null values are not allowed by the application (such as in primitives). Note: the default value for NULL is used on reads, writes, and query SQL generation

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