Package org.apache.ibatis.type
Class BaseTypeHandler<T>
java.lang.Object
org.apache.ibatis.type.TypeReference<T>
org.apache.ibatis.type.BaseTypeHandler<T>
- All Implemented Interfaces:
TypeHandler<T>
- Direct Known Subclasses:
ArrayTypeHandler
,BigDecimalTypeHandler
,BigIntegerTypeHandler
,BlobByteObjectArrayTypeHandler
,BlobInputStreamTypeHandler
,BlobTypeHandler
,BooleanTypeHandler
,ByteArrayTypeHandler
,ByteObjectArrayTypeHandler
,ByteTypeHandler
,CharacterTypeHandler
,ClobReaderTypeHandler
,ClobTypeHandler
,DateOnlyTypeHandler
,DateTypeHandler
,DoubleTypeHandler
,EnumOrdinalTypeHandler
,EnumTypeHandler
,FloatTypeHandler
,InstantTypeHandler
,IntegerTypeHandler
,JapaneseDateTypeHandler
,LocalDateTimeTypeHandler
,LocalDateTypeHandler
,LocalTimeTypeHandler
,LongTypeHandler
,MonthTypeHandler
,NClobTypeHandler
,NStringTypeHandler
,ObjectTypeHandler
,OffsetDateTimeTypeHandler
,OffsetTimeTypeHandler
,ShortTypeHandler
,SqlDateTypeHandler
,SqlTimestampTypeHandler
,SqlTimeTypeHandler
,SqlxmlTypeHandler
,StringTypeHandler
,TimeOnlyTypeHandler
,UnknownTypeHandler
,YearMonthTypeHandler
,YearTypeHandler
,ZonedDateTimeTypeHandler
The base
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.
- Author:
- Clinton Begin, Simone Tripodi, Kzuki Shimizu
-
Field Summary
Modifier and TypeFieldDescriptionprotected Configuration
Deprecated.Since 3.5.0 - See https://github.com/mybatis/mybatis-3/issues/1203. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract T
getNullableResult
(CallableStatement cs, int columnIndex) abstract T
getNullableResult
(ResultSet rs, int columnIndex) abstract T
getNullableResult
(ResultSet rs, String columnName) Gets the nullable result.getResult
(CallableStatement cs, int columnIndex) Gets the result.void
Deprecated.Since 3.5.0 - See https://github.com/mybatis/mybatis-3/issues/1203.abstract void
setNonNullParameter
(PreparedStatement ps, int i, T parameter, JdbcType jdbcType) void
setParameter
(PreparedStatement ps, int i, T parameter, JdbcType jdbcType) Methods inherited from class org.apache.ibatis.type.TypeReference
getRawType, toString
-
Field Details
-
configuration
Deprecated.Since 3.5.0 - See https://github.com/mybatis/mybatis-3/issues/1203. This field will remove future.
-
-
Constructor Details
-
BaseTypeHandler
public BaseTypeHandler()
-
-
Method Details
-
setConfiguration
Deprecated.Since 3.5.0 - See https://github.com/mybatis/mybatis-3/issues/1203. This property will remove future.Sets the configuration.- Parameters:
c
- the new configuration
-
setParameter
public void setParameter(PreparedStatement ps, int i, T parameter, JdbcType jdbcType) throws SQLException - Specified by:
setParameter
in interfaceTypeHandler<T>
- Throws:
SQLException
-
getResult
Description copied from interface:TypeHandler
Gets the result.- Specified by:
getResult
in interfaceTypeHandler<T>
- Parameters:
rs
- the rscolumnName
- Column name, when configurationuseColumnLabel
isfalse
- Returns:
- the result
- Throws:
SQLException
- the SQL exception
-
getResult
- Specified by:
getResult
in interfaceTypeHandler<T>
- Throws:
SQLException
-
getResult
- Specified by:
getResult
in interfaceTypeHandler<T>
- Throws:
SQLException
-
setNonNullParameter
public abstract void setNonNullParameter(PreparedStatement ps, int i, T parameter, JdbcType jdbcType) throws SQLException - Throws:
SQLException
-
getNullableResult
Gets the nullable result.- Parameters:
rs
- the rscolumnName
- Column name, when configurationuseColumnLabel
isfalse
- Returns:
- the nullable result
- Throws:
SQLException
- the SQL exception
-
getNullableResult
- Throws:
SQLException
-
getNullableResult
- Throws:
SQLException
-