public abstract class BaseTypeHandler<T> extends TypeReference<T> implements TypeHandler<T>
TypeHandler
for references a generic type.
Important: Since 3.5.0, This class never call the ResultSet.wasNull()
and
CallableStatement.wasNull()
method for handling the SQL NULL
value.
In other words, null
value handling should be performed on subclass.
Modifier and Type | Field and Description |
---|---|
protected Configuration |
configuration
Deprecated.
Since 3.5.0 - See https://github.com/mybatis/mybatis-3/issues/1203. This field will remove future.
|
Constructor and Description |
---|
BaseTypeHandler() |
Modifier and Type | Method and Description |
---|---|
abstract T |
getNullableResult(CallableStatement cs,
int columnIndex) |
abstract T |
getNullableResult(ResultSet rs,
int columnIndex) |
abstract T |
getNullableResult(ResultSet rs,
String columnName)
Gets the nullable result.
|
T |
getResult(CallableStatement cs,
int columnIndex) |
T |
getResult(ResultSet rs,
int columnIndex) |
T |
getResult(ResultSet rs,
String columnName)
Gets the result.
|
void |
setConfiguration(Configuration c)
Deprecated.
Since 3.5.0 - See https://github.com/mybatis/mybatis-3/issues/1203. This property will remove future.
|
abstract void |
setNonNullParameter(PreparedStatement ps,
int i,
T parameter,
JdbcType jdbcType) |
void |
setParameter(PreparedStatement ps,
int i,
T parameter,
JdbcType jdbcType) |
getRawType, toString
@Deprecated protected Configuration configuration
@Deprecated public void setConfiguration(Configuration c)
c
- the new configurationpublic void setParameter(PreparedStatement ps, int i, T parameter, JdbcType jdbcType) throws SQLException
setParameter
in interface TypeHandler<T>
SQLException
public T getResult(ResultSet rs, String columnName) throws SQLException
TypeHandler
getResult
in interface TypeHandler<T>
rs
- the rscolumnName
- Colunm name, when configuration useColumnLabel
is false
SQLException
- the SQL exceptionpublic T getResult(ResultSet rs, int columnIndex) throws SQLException
getResult
in interface TypeHandler<T>
SQLException
public T getResult(CallableStatement cs, int columnIndex) throws SQLException
getResult
in interface TypeHandler<T>
SQLException
public abstract void setNonNullParameter(PreparedStatement ps, int i, T parameter, JdbcType jdbcType) throws SQLException
SQLException
public abstract T getNullableResult(ResultSet rs, String columnName) throws SQLException
rs
- the rscolumnName
- Colunm name, when configuration useColumnLabel
is false
SQLException
- the SQL exceptionpublic abstract T getNullableResult(ResultSet rs, int columnIndex) throws SQLException
SQLException
public abstract T getNullableResult(CallableStatement cs, int columnIndex) throws SQLException
SQLException
Copyright © 2009–2021 MyBatis.org. All rights reserved.