public class SerializedObjectConverter extends Object implements Converter
Purpose: The serialized object converter can be used to store an arbitrary object or set of objects into a database blob field. It uses the Java serializer so the target must be serializable.
Modifier and Type | Field and Description |
---|---|
protected DatabaseMapping |
mapping |
Constructor and Description |
---|
SerializedObjectConverter()
PUBLIC:
Default constructor.
|
SerializedObjectConverter(DatabaseMapping mapping)
PUBLIC:
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
convertDataValueToObjectValue(Object fieldValue,
Session session)
INTERNAL:
The fieldValue will be a byte array.
|
Object |
convertObjectValueToDataValue(Object attributeValue,
Session session)
INTERNAL:
Convert the object to a byte array through serialize.
|
protected DatabaseMapping |
getMapping()
INTERNAL:
Return the mapping.
|
void |
initialize(DatabaseMapping mapping,
Session session)
INTERNAL:
Set the mapping.
|
boolean |
isMutable()
INTERNAL:
If the converter converts the value to a non-atomic value, i.e.
|
protected DatabaseMapping mapping
public SerializedObjectConverter()
public SerializedObjectConverter(DatabaseMapping mapping)
public Object convertDataValueToObjectValue(Object fieldValue, Session session) throws DescriptorException
convertDataValueToObjectValue
in interface Converter
DescriptorException
public Object convertObjectValueToDataValue(Object attributeValue, Session session)
convertObjectValueToDataValue
in interface Converter
public void initialize(DatabaseMapping mapping, Session session)
initialize
in interface Converter
protected DatabaseMapping getMapping()
Copyright © 2021. All rights reserved.