Skip Headers

# Using a Converter Mapping

Previous

Next

If the attribute type is comparable to a database type but requires conversion, the information can be stored directly by using a direct-to-field mapping (see "Direct-to-Field Mapping") and an appropriate `Converter` instance.

In the previous release, TopLink provided subclasses of `DirectToFieldMapping` for object type direct mappings, serialized object direct mappings, and type conversion direct mappings. In this release, these subclasses are deprecated. In their place, Oracle recommends that you use the `DirectToFieldMapping` method `setConverter` and the corresponding `Converter` instance. Table: Using a Converter for Direct-to-Field Mappings summarizes these changes.

Using a Converter for Direct-to-Field Mappings

Deprecated DirectToFieldMapping subclass... | Replaced by Converter instance...
--- | ---
`ObjectTypeMapping` | `ObjectTypeConverter` (see "Object Type Converter")
`SerializedObjectMapping` | `SerializedObjectConverter` (see "Serialized Object Converter")
`TypeConversionMapping` | `TypeConversionConverter` (see "Type Conversion Converter"

If the application's objects contain attributes that cannot be represented as direct-to-field with an existing converter, use a direct-to-field mapping with a custom converter.