Skip Headers
Oracle® TopLink Developer's Guide
10g (10.1.3.1.0)
B28218-01
  Go To Documentation Library
Library
Go To Product List
Product
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
 
Next
Next
 

Configuring a Serialized Object Converter

A serialized object converter can be used to store an arbitrary object or set of objects into a data source binary large object (BLOB) field. It uses the Java serializer so the target must be serializable.

For more information about the serialized object converter, see "Serialized Object Converter".

Table 32-10 summarizes which mappings support this option.

Using TopLink Workbench

To create an serialized object direct mapping, use this procedure:

  1. Select the mapped attribute in the Navigator. Its properties appear in the Editor.

  2. Click the Converter tab. The Converter tab appears.

    Figure 32-10 Converter Tab, Serialized Object Converter Option

    Description of Figure 32-10 follows
    Description of "Figure 32-10 Converter Tab, Serialized Object Converter Option"

To specify a serialized object converter, select the Serialized Object Converter option.

Using Java

You can set an oracle.toplink.converters.SerializedObjectConverter on any instance of oracle.toplink.mappings.foundation.AbstractCompositeDirectCollectionMapping using AbstractCompositeDirectCollectionMapping method setValueConverter as Example 32-11 shows.

Example 32-11 Configuring a SerializedObjectConverter in Java

// Create SerializedObjectConverter instance
SerializedObjectConverter serializedObjectConvter = new SerializedObjectConverter();

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