public abstract class SqlType<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DB_SQLTYPE_NOT_AVAILABLE
Indicator for unavailable DB SQL type.
|
static int |
DB_SQLTYPE_UNKNOWN
Indicator for not yet resolved DB SQL type.
|
protected java.lang.Class<T> |
sqlType |
Modifier | Constructor and Description |
---|---|
protected |
SqlType() |
Modifier and Type | Method and Description |
---|---|
abstract T |
get(java.sql.ResultSet rs,
int index,
int dbSqlType)
Returns value from result set.
|
protected <E> E |
prepareGetValue(T t,
java.lang.Class<E> destinationType)
Once when value is read from result set, prepare it to match destination type.
|
<E> E |
readValue(java.sql.ResultSet rs,
int index,
java.lang.Class<E> destinationType,
int dbSqlType)
Reads value from database.
|
abstract void |
set(java.sql.PreparedStatement st,
int index,
T value,
int dbSqlType)
Sets prepared statement value.
|
void |
storeValue(java.sql.PreparedStatement st,
int index,
java.lang.Object value,
int dbSqlType)
Stores value in database.
|
public static final int DB_SQLTYPE_UNKNOWN
public static final int DB_SQLTYPE_NOT_AVAILABLE
protected java.lang.Class<T> sqlType
public abstract void set(java.sql.PreparedStatement st, int index, T value, int dbSqlType) throws java.sql.SQLException
java.sql.SQLException
public abstract T get(java.sql.ResultSet rs, int index, int dbSqlType) throws java.sql.SQLException
rs
- result setindex
- column indexdbSqlType
- java.sql.Types hintjava.sql.SQLException
public void storeValue(java.sql.PreparedStatement st, int index, java.lang.Object value, int dbSqlType) throws java.sql.SQLException
java.sql.SQLException
public <E> E readValue(java.sql.ResultSet rs, int index, java.lang.Class<E> destinationType, int dbSqlType) throws java.sql.SQLException
rs
- result setindex
- database column indexdestinationType
- property typedbSqlType
- hint for column sql type valuejava.sql.SQLException
protected <E> E prepareGetValue(T t, java.lang.Class<E> destinationType)
t
- get valuedestinationType
- destination typeCopyright © 2003-present Jodd Team