Oracle Fusion Middleware Java API Reference for Oracle TopLink (Deprecated)
11g Release 1 (11.1.1)

B32476-04

oracle.toplink.mappings.converters
Interface Converter

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
XMLConverter
All Known Implementing Classes:
ClassInstanceConverter, EnumTypeConverter, JAXBTypesafeEnumConverter, ObjectTypeConverter, SerializedObjectConverter, TypeConversionConverter, XMLConverterAdapter, XMLJavaTypeConverter

public interface Converter
extends java.io.Serializable

Purpose: Conversion interface to allow conversion between object and data types. This can be used in any mapping to convert between the object and data types without requiring code placed in the object model. TopLink provides several common converters, but the application can also define it own.

Since:
OracleAS TopLink 10g (10.0.3)
See Also:
AbstractDirectMapping.setConverter(Converter), DirectCollectionMapping#setConverter(Converter), ObjectTypeConverter, TypeConversionConverter, SerializedObjectConverter

Method Summary
 java.lang.Object convertDataValueToObjectValue(java.lang.Object dataValue, Session session)
          Convert the databases' data representation of the value to the object's representation.
 java.lang.Object convertObjectValueToDataValue(java.lang.Object objectValue, Session session)
          Convert the object's representation of the value to the databases' data representation.
 void initialize(DatabaseMapping mapping, Session session)
          Allow for any initialization.
 boolean isMutable()
          If the converter converts the value to a mutable value, i.e.
 

Method Detail

convertObjectValueToDataValue

java.lang.Object convertObjectValueToDataValue(java.lang.Object objectValue,
                                               Session session)
Convert the object's representation of the value to the databases' data representation. For example this could convert between a Calendar Java type and the sql.Time datatype.


convertDataValueToObjectValue

java.lang.Object convertDataValueToObjectValue(java.lang.Object dataValue,
                                               Session session)
Convert the databases' data representation of the value to the object's representation. For example this could convert between an sql.Time datatype and the Java Calendar type.


isMutable

boolean isMutable()
If the converter converts the value to a mutable value, i.e. a value that can have its' parts changed without being replaced, then it must return true. If the value is not mutable, cannot be changed without replacing the whole value then false must be returned. This is used within the UnitOfWork to determine how to clone.


initialize

void initialize(DatabaseMapping mapping,
                Session session)
Allow for any initialization.


Copyright © 1998, 2012, Oracle. All Rights Reserved.