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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ConfigurationDeprecated.Since 3.5.0 - See https://github.com/mybatis/mybatis-3/issues/1203. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract TgetNullableResult(CallableStatement cs, int columnIndex) abstract TgetNullableResult(ResultSet rs, int columnIndex) abstract TgetNullableResult(ResultSet rs, String columnName) Gets the nullable result.getResult(CallableStatement cs, int columnIndex) Gets the result.voidDeprecated.Since 3.5.0 - See https://github.com/mybatis/mybatis-3/issues/1203.abstract voidsetNonNullParameter(PreparedStatement ps, int i, T parameter, JdbcType jdbcType) voidsetParameter(PreparedStatement ps, int i, T parameter, JdbcType jdbcType) Methods inherited from class TypeReference
getRawType, getSuperclassTypeParameter, 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:
setParameterin interfaceTypeHandler<T>- Throws:
SQLException
-
getResult
Description copied from interface:TypeHandlerGets the result.- Specified by:
getResultin interfaceTypeHandler<T>- Parameters:
rs- the rscolumnName- Column name, when configurationuseColumnLabelisfalse- Returns:
- the result
- Throws:
SQLException- the SQL exception
-
getResult
- Specified by:
getResultin interfaceTypeHandler<T>- Throws:
SQLException
-
getResult
- Specified by:
getResultin 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 configurationuseColumnLabelisfalse- Returns:
- the nullable result
- Throws:
SQLException- the SQL exception
-
getNullableResult
- Throws:
SQLException
-
getNullableResult
- Throws:
SQLException
-