public interface Mapping
FieldType
instances which determines
how they are stored in a SQL database.Modifier and Type | Method and Description |
---|---|
FieldType |
mapAttribute(Attribute<?,?> attribute)
Get the mapped storage type mapping for a given type
Attribute . |
<T> Mapping |
putType(Class<? super T> type,
FieldType<T> fieldType)
Map a specific java class type to a
FieldType instance. |
<A> A |
read(Expression<A> expression,
ResultSet results,
int column)
Given the expression read it from
ResultSet instance. |
boolean |
readBoolean(ResultSet results,
int column)
Reads a boolean value.
|
byte |
readByte(ResultSet results,
int column)
Reads a byte value.
|
double |
readDouble(ResultSet results,
int column)
Reads a double value.
|
float |
readFloat(ResultSet results,
int column)
Reads a float value.
|
int |
readInt(ResultSet results,
int column)
Reads a integer value.
|
long |
readLong(ResultSet results,
int column)
Reads a long value.
|
short |
readShort(ResultSet results,
int column)
Reads a boolean value.
|
<T> Mapping |
replaceType(int sqlType,
FieldType<T> replacementType)
|
Class<?> |
typeOf(int sqlType)
Get the mapped storage type mapping for a given sql type.
|
<A> void |
write(Expression<A> expression,
PreparedStatement statement,
int index,
A value)
Given the expression bind it into a JDBC
PreparedStatement . |
void |
writeBoolean(PreparedStatement statement,
int index,
boolean value)
Sets a boolean value
|
void |
writeByte(PreparedStatement statement,
int index,
byte value)
Sets a byte value
|
void |
writeDouble(PreparedStatement statement,
int index,
double value)
Sets a double value
|
void |
writeFloat(PreparedStatement statement,
int index,
float value)
Sets a float value
|
void |
writeInt(PreparedStatement statement,
int index,
int value)
Sets a int value
|
void |
writeLong(PreparedStatement statement,
int index,
long value)
Sets a long value
|
void |
writeShort(PreparedStatement statement,
int index,
short value)
Sets a short value
|
<T> Mapping putType(Class<? super T> type, FieldType<T> fieldType)
FieldType
instance.T
- the mapped typetype
- non null java class typefieldType
- non null storage type<T> Mapping replaceType(int sqlType, FieldType<T> replacementType)
FieldType
to a another FieldType
. If the
basic type is not mapped then a mapping will be added.T
- the mapped typesqlType
- Types
to replacereplacementType
- non null replacement typeFieldType mapAttribute(Attribute<?,?> attribute)
Attribute
.attribute
- attribute non null attributeFieldType
Class<?> typeOf(int sqlType)
sqlType
- Types
type<A> A read(Expression<A> expression, ResultSet results, int column) throws SQLException
ResultSet
instance.A
- type to readexpression
- expression to readresults
- ResultSet
instancecolumn
- column indexSQLException
- on a failure to read from the ResultSet
boolean readBoolean(ResultSet results, int column) throws SQLException
results
- ResultSet
instancecolumn
- column indexSQLException
- on a failure to read from the ResultSet
byte readByte(ResultSet results, int column) throws SQLException
results
- ResultSet
instancecolumn
- column indexSQLException
- on a failure to read from the ResultSet
short readShort(ResultSet results, int column) throws SQLException
results
- ResultSet
instancecolumn
- column indexSQLException
- on a failure to read from the ResultSet
int readInt(ResultSet results, int column) throws SQLException
results
- ResultSet
instancecolumn
- column indexSQLException
- on a failure to read from the ResultSet
long readLong(ResultSet results, int column) throws SQLException
results
- ResultSet
instancecolumn
- column indexSQLException
- on a failure to read from the ResultSet
float readFloat(ResultSet results, int column) throws SQLException
results
- ResultSet
instancecolumn
- column indexSQLException
- on a failure to read from the ResultSet
double readDouble(ResultSet results, int column) throws SQLException
results
- ResultSet
instancecolumn
- column indexSQLException
- on a failure to read from the ResultSet
<A> void write(Expression<A> expression, PreparedStatement statement, int index, A value) throws SQLException
PreparedStatement
.A
- type to be boundexpression
- to bindstatement
- prepared statement instanceindex
- statement indexvalue
- valueSQLException
- on a failure to set the expression on the PreparedStatement
void writeBoolean(PreparedStatement statement, int index, boolean value) throws SQLException
statement
- prepared statementindex
- statement indexvalue
- type to be boundSQLException
- on a failure to set the expression on the PreparedStatement
void writeByte(PreparedStatement statement, int index, byte value) throws SQLException
statement
- prepared statementindex
- statement indexvalue
- type to be boundSQLException
- on a failure to set the expression on the PreparedStatement
void writeShort(PreparedStatement statement, int index, short value) throws SQLException
statement
- prepared statementindex
- statement indexvalue
- type to be boundSQLException
- on a failure to set the expression on the PreparedStatement
void writeInt(PreparedStatement statement, int index, int value) throws SQLException
statement
- prepared statementindex
- statement indexvalue
- type to be boundSQLException
- on a failure to set the expression on the PreparedStatement
void writeLong(PreparedStatement statement, int index, long value) throws SQLException
statement
- prepared statementindex
- statement indexvalue
- type to be boundSQLException
- on a failure to set the expression on the PreparedStatement
void writeFloat(PreparedStatement statement, int index, float value) throws SQLException
statement
- prepared statementindex
- statement indexvalue
- type to be boundSQLException
- on a failure to set the expression on the PreparedStatement
void writeDouble(PreparedStatement statement, int index, double value) throws SQLException
statement
- prepared statementindex
- statement indexvalue
- type to be boundSQLException
- on a failure to set the expression on the PreparedStatement