Interface StructConverter
- All Known Implementing Classes:
JGeometryConverter
public interface StructConverter
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.
-
Method Summary
Modifier and TypeMethodDescriptionconvertToObject
(Struct struct) PUBLIC: This method will be invoked internally when reading a Struct from the database Implementers should put any custom conversion logic in this methodconvertToStruct
(Object struct, 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 methodPUBLIC:PUBLIC:
-
Method Details
-
getStructName
String getStructName()PUBLIC:- Returns:
- The value return by getSQLTypeName() called when called on the appropriate Struct
-
getJavaType
Class getJavaType()PUBLIC:- Returns:
- The Java Class to perform conversions on
-
convertToObject
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
- the Struct that will be read- Returns:
- The Object converted back from the Struct
- Throws:
SQLException
-
convertToStruct
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
- The Object to convertconnection
- The JDBC connection- Returns:
- The Object as a Struct
- Throws:
SQLException
-