DB_TYPE
- the type as it is represented in the JDBC driverJAVA_TYPE
- the type as it should be represented in generated codepublic interface TypeMapper<DB_TYPE,JAVA_TYPE>
TypeMapperComponent
.Modifier and Type | Field and Description |
---|---|
static Comparator<TypeMapper<?,?>> |
COMPARATOR
The standard comparator to use for instances of the
TypeMapper
interface. |
Modifier and Type | Method and Description |
---|---|
Type |
getJavaType(Column column)
Returns a type describing the resulting java type when this mapper is
applied to a database result.
|
String |
getLabel()
Returns the label for this mapper that should appear to the end user.
|
static <T> TypeMapper<T,T> |
identity()
Returns an identity type mapper.
|
static <T> TypeMapper<T,T> |
primitive()
Returns an primitive type mapper.
|
DB_TYPE |
toDatabaseType(JAVA_TYPE value)
Converts a value from the java domain to the database domain.
|
JAVA_TYPE |
toJavaType(Column column,
Class<?> entityType,
DB_TYPE value)
Converts a value from the database domain to the java domain.
|
static final Comparator<TypeMapper<?,?>> COMPARATOR
TypeMapper
interface. This comparator will use the name of the database type as
comparison index and if two mappers share the same database type, it will
use the label in alphabetical order.String getLabel()
Type getJavaType(Column column)
column
- the column that is being mappedJAVA_TYPE toJavaType(Column column, Class<?> entityType, DB_TYPE value)
column
- the column that is being mappedentityType
- the entity type that the mapping is forvalue
- the value to convertDB_TYPE toDatabaseType(JAVA_TYPE value)
value
- the value to convertstatic <T> TypeMapper<T,T> identity()
T
- the type of the identity type mapperstatic <T> TypeMapper<T,T> primitive()
T
- the wrapper type of the primitive type mapperCopyright © 2017 Speedment, Inc.. All rights reserved.