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.SQLExceptionpublic 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.SQLExceptionpublic void storeValue(java.sql.PreparedStatement st,
int index,
java.lang.Object value,
int dbSqlType)
throws java.sql.SQLException
java.sql.SQLExceptionpublic <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.SQLExceptionprotected <E> E prepareGetValue(T t, java.lang.Class<E> destinationType)
t - get valuedestinationType - destination typeCopyright © 2003-present Jodd Team