Oracle TopLink Developer's Guide
10g Release 3 (10.1.3) B13593-01 |
|
![]() Previous |
![]() Next |
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 35-10 summarizes which mappings support this option.
Table 35-10 Mapping Support for Serialized Object Converter
Mapping | Using TopLink Workbench
|
Using Java
|
---|---|---|
|
|
|
|
|
|
|
|
|
Object-Relational Array Mapping |
![]() |
|
|
|
|
|
|
|
EIS Composite Direct Collection Mapping |
|
|
|
|
|
|
|
|
XML Composite Direct Collection Mapping |
|
|
To create an serialized object direct mapping, use this procedure:
Select the mapped attribute in the Navigator. Its properties appear in the Editor.
Click the Converter tab. The Converter tab appears.
Figure 35-10 Converter Tab, Serialized Object Mapping
To specify a serialized object converter, select the Serialized Object Converter option.
You can set an oracle.toplink.converters.SerializedObjectConverter
on any instance of oracle.toplink.mappings.foundation.AbstractCompositeDirectCollectionMapping
using AbstractCompositeDirectCollectionMapping
method setValueConverter
as Example 35-11 shows.
Example 35-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);