Skip Headers

# Serialized Object Converter

Previous

Next

The serialized object converter is an extension of direct and direct collection mappings that lets you map complex objects into binary fields through Java object serialization. Serialized objects are normally stored in `RAW` or Binary Large Object (`BLOB)` fields in the database, or `HEX` or `BASE64` elements in an XML document.

Figure: Serialized Object Converter (relational) shows an example of a direct-to-field mappings that uses a serialized object converter. The attribute `jobDescription` contains a formatted text document that is stored in the JOB_DESC field of the database.

Serialized Object Converter (relational)

Description of "Serialized Object Converter (relational)"

Figure: Type Conversion Mapping (relational) demonstrates an example of a nonrelational mapping that uses a serialized object converter. The attribute `jobDescription` contains a formatted text document that TopLink stores in the `JOB DESCRIPTION` element of an XML schema.

Serialized Object Converter (nonrelational)

Description of "Serialized Object Converter (nonrelational)"

The serialized object converter relies on the Java serializer. Before you map a domain object with the serialized object converter, ensure that the domain object implements the `java.io.Serializable` interface (or inherits that implementation) and marks all nonserializable fields transient.

For more information, see "Configuring a Serialized Object Converter".