| Constructor and Description |
|---|
GenericMapping(Platform platform) |
| Modifier and Type | Method and Description |
|---|---|
void |
addConverter(Converter<?,?> converter,
Class<?>... classes) |
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
|
public GenericMapping(Platform platform)
public <T> Mapping replaceType(int sqlType, FieldType<T> replacementType)
MappingFieldType to a another FieldType. If the
basic type is not mapped then a mapping will be added.replaceType in interface MappingT - the mapped typesqlType - Types to replacereplacementType - non null replacement typepublic <T> Mapping putType(Class<? super T> type, FieldType<T> fieldType)
MappingFieldType instance.public FieldType mapAttribute(Attribute<?,?> attribute)
MappingAttribute.mapAttribute in interface Mappingattribute - attribute non null attributeFieldTypepublic Class<?> typeOf(int sqlType)
Mappingpublic <A> A read(Expression<A> expression, ResultSet results, int column) throws SQLException
MappingResultSet instance.read in interface MappingA - type to readexpression - expression to readresults - ResultSet instancecolumn - column indexSQLException - on a failure to read from the ResultSetpublic boolean readBoolean(ResultSet results, int column) throws SQLException
MappingreadBoolean in interface Mappingresults - ResultSet instancecolumn - column indexSQLException - on a failure to read from the ResultSetpublic byte readByte(ResultSet results, int column) throws SQLException
MappingreadByte in interface Mappingresults - ResultSet instancecolumn - column indexSQLException - on a failure to read from the ResultSetpublic short readShort(ResultSet results, int column) throws SQLException
MappingreadShort in interface Mappingresults - ResultSet instancecolumn - column indexSQLException - on a failure to read from the ResultSetpublic int readInt(ResultSet results, int column) throws SQLException
MappingreadInt in interface Mappingresults - ResultSet instancecolumn - column indexSQLException - on a failure to read from the ResultSetpublic long readLong(ResultSet results, int column) throws SQLException
MappingreadLong in interface Mappingresults - ResultSet instancecolumn - column indexSQLException - on a failure to read from the ResultSetpublic float readFloat(ResultSet results, int column) throws SQLException
MappingreadFloat in interface Mappingresults - ResultSet instancecolumn - column indexSQLException - on a failure to read from the ResultSetpublic double readDouble(ResultSet results, int column) throws SQLException
MappingreadDouble in interface Mappingresults - ResultSet instancecolumn - column indexSQLException - on a failure to read from the ResultSetpublic <A> void write(Expression<A> expression, PreparedStatement statement, int index, A value) throws SQLException
MappingPreparedStatement.write in interface MappingA - type to be boundexpression - to bindstatement - prepared statement instanceindex - statement indexvalue - valueSQLException - on a failure to set the expression on the PreparedStatementpublic void writeBoolean(PreparedStatement statement, int index, boolean value) throws SQLException
MappingwriteBoolean in interface Mappingstatement - prepared statementindex - statement indexvalue - type to be boundSQLException - on a failure to set the expression on the PreparedStatementpublic void writeByte(PreparedStatement statement, int index, byte value) throws SQLException
MappingwriteByte in interface Mappingstatement - prepared statementindex - statement indexvalue - type to be boundSQLException - on a failure to set the expression on the PreparedStatementpublic void writeShort(PreparedStatement statement, int index, short value) throws SQLException
MappingwriteShort in interface Mappingstatement - prepared statementindex - statement indexvalue - type to be boundSQLException - on a failure to set the expression on the PreparedStatementpublic void writeInt(PreparedStatement statement, int index, int value) throws SQLException
MappingwriteInt in interface Mappingstatement - prepared statementindex - statement indexvalue - type to be boundSQLException - on a failure to set the expression on the PreparedStatementpublic void writeLong(PreparedStatement statement, int index, long value) throws SQLException
MappingwriteLong in interface Mappingstatement - prepared statementindex - statement indexvalue - type to be boundSQLException - on a failure to set the expression on the PreparedStatementpublic void writeFloat(PreparedStatement statement, int index, float value) throws SQLException
MappingwriteFloat in interface Mappingstatement - prepared statementindex - statement indexvalue - type to be boundSQLException - on a failure to set the expression on the PreparedStatementpublic void writeDouble(PreparedStatement statement, int index, double value) throws SQLException
MappingwriteDouble in interface Mappingstatement - prepared statementindex - statement indexvalue - type to be boundSQLException - on a failure to set the expression on the PreparedStatement