Top Description Methods
org.eclipse.persistence.platform.database.converters

public Interface StructConverter

Imports
java.sql.Connection, .SQLException, .Struct

PUBLIC: A StuctConverter can be added to a DatabasePlatform It allows custom processing dealing java.sql.Struct types When added to the DatabasePlatform: 1. convertToObject(Struct) will be invoked when a Struct named by the value returned by getStructName() is returned from the database. This conversion happens immediately after the object is returned from the database 2. convertToStruct(Object, Connection) will be invoked when an Object of the class returned by getJavaType() is written to the database. This conversion happens immediately before the object is written to the database Note: Many Structs can also be mapped with mappings StructureMapping and ObjectRelationalDataTypeDescriptor This class provides support for advanced types of Structures that require some processing immediately before writing to the database or immediately after reading from the database.
See Also
org.eclipse.persistence.mappings.structures.StructureMapping, org.eclipse.persistence.mappings.structures.ObjectRelationalDataTypeDescriptor

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

The Object converted back from the Struct
convertToObject
(Struct
the Struct that will be read
struct
)

PUBLIC: This method will be invoked internally when reading a Struct from the database Implementers should put any custom conversion logic in this method

public Struct

Returns:

The Object as a Struct
convertToStruct
(Object
The Object to convert
struct
,
Connection
The JDBC connection
connection
)

PUBLIC: This method will be invoked internally when writing an Object to the database Implementers should put any custom conversion logic in this method

public Class<?>

Returns:

The Java Class to perform conversions on
getJavaType
()

PUBLIC:

public String

Returns:

The value return by getSQLTypeName() called when called on the appropriate Struct
getStructName
()

PUBLIC:

Method Detail

convertToObjectback to summary
public Object convertToObject(Struct struct) throws SQLException

PUBLIC: This method will be invoked internally when reading a Struct from the database Implementers should put any custom conversion logic in this method

Parameters
struct:Struct

the Struct that will be read

Returns:Object

The Object converted back from the Struct

convertToStructback to summary
public Struct convertToStruct(Object struct, Connection connection) throws SQLException

PUBLIC: This method will be invoked internally when writing an Object to the database Implementers should put any custom conversion logic in this method

Parameters
struct:Object

The Object to convert

connection:Connection

The JDBC connection

Returns:Struct

The Object as a Struct

getJavaTypeback to summary
public Class<?> getJavaType()

PUBLIC:

Returns:Class<?>

The Java Class to perform conversions on

getStructNameback to summary
public String getStructName()

PUBLIC:

Returns:String

The value return by getSQLTypeName() called when called on the appropriate Struct