CustomDataTypesHandler

Custom data type handler Provides means to plug-in custom data types support Please keep in mind that this feature may not possibly provide the same ABI stability level as other features as it exposes many of the H2 internals. You may be required to update your code occasionally due to internal changes in H2 if you are going to use this feature

Methods
Value convert(Value source, int targetType)
Convert the provided source value into value of given target data type Shall implement conversions to and from custom data types.
Value convert(Value source, int targetType)
Convert the provided source value into value of given target data type Shall implement conversions to and from custom data types.
Parameters:
source - source value
targetType - identifier of target data type
Returns:
converted value
int getAddProofType(int type)
Get compatible type identifier that would not overflow after many add operations.
int getAddProofType(int type)
Get compatible type identifier that would not overflow after many add operations.
Parameters:
type - identifier of a type
Returns:
resulting type identifier
DataType getDataTypeById(int type)
Get custom data type given its integer id
DataType getDataTypeById(int type)
Get custom data type given its integer id
Parameters:
type - identifier of a data type
Returns:
custom data type
DataType getDataTypeByName(String name)
Get custom data type given its name
DataType getDataTypeByName(String name)
Get custom data type given its name
Parameters:
name - data type name
Returns:
custom data type
String getDataTypeClassName(int type)
Get custom data type class name given its integer id
String getDataTypeClassName(int type)
Get custom data type class name given its integer id
Parameters:
type - identifier of a data type
Returns:
class name
int getDataTypeOrder(int type)
Get order for custom data type given its integer id
int getDataTypeOrder(int type)
Get order for custom data type given its integer id
Parameters:
type - identifier of a data type
Returns:
order associated with custom data type
Object getObject(Value value, Class cls)
Converts
Object getObject(Value value, Class cls)
Converts {@link org.h2.value.Value} object to the specified class.
Parameters:
value - the value to convert
cls - the target class
Returns:
result
int getTypeIdFromClass(Class cls)
Get custom data type identifier given corresponding Java class
int getTypeIdFromClass(Class cls)
Get custom data type identifier given corresponding Java class
Parameters:
cls - Java class object
Returns:
type identifier
Value getValue(int type, Object data, DataHandler dataHandler)
Get
Value getValue(int type, Object data, DataHandler dataHandler)
Get {@link org.h2.value.Value} object corresponding to given data type identifier and data.
Parameters:
type - custom data type identifier
data - underlying data type value
dataHandler - data handler object
Returns:
Value object
boolean supportsAdd(int type)
Checks if type supports add operation
boolean supportsAdd(int type)
Checks if type supports add operation
Parameters:
type - custom data type identifier
Returns:
True, if custom data type supports add operation