Skip Headers

# Using Java

Previous

Next

You can set an `oracle.toplink.converters.TypeConversionConverter` on any instance of `oracle.toplink.mappings.foundation.AbstractCompositeDirectCollectionMapping` using `AbstractCompositeDirectCollectionMapping` method `setValueConverter` as Example: Configuring a TypeConversionConverter in Java shows.

Configuring a TypeConversionConverter in Java

    // Create TypeConversionConverter instance
    TypeConversionConverter typeConversionConverter = new TypeConversionConverter();
    typeConversionConverter.setDataClass();
    typeConversionConverter.setObjectClass();

    // Set TypeConversionConverter on ArrayMapping
    ArrayMapping arrayMapping = new ArrayMapping();
    arrayMapping.setValueConverter(typeConversionConverter);
    arrayMapping.setAttributeName("responsibilities");
    arrayMapping.setStructureName("Responsibilities_t");
    arrayMapping.setFieldName("RESPONSIBILITIES");
    orDescriptor.addMapping(arrayMapping);

Configure the `TypeConversionConverter` instance using the following API:

- `setDataClass(java.lang.Class dataClass)`–to specify the data type class

- `setObjectClass(java.lang.Class objectClass)`–to specify the object type class