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
public abstract class BaseTypeHandler<T> extends TypeReference<T> implements TypeHandler<T>
The baseTypeHandlerfor references a generic type.Important: Since 3.5.0, This class never call the
ResultSet.wasNull()andCallableStatement.wasNull()method for handling the SQLNULLvalue. In other words,nullvalue handling should be performed on subclass.- Author:
- Clinton Begin, Simone Tripodi, Kzuki Shimizu
-
-
Field Summary
Fields Modifier and Type Field Description protected ConfigurationconfigurationDeprecated.Since 3.5.0 - See https://github.com/mybatis/mybatis-3/issues/1203.
-
Constructor Summary
Constructors Constructor Description BaseTypeHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract TgetNullableResult(java.sql.CallableStatement cs, int columnIndex)abstract TgetNullableResult(java.sql.ResultSet rs, int columnIndex)abstract TgetNullableResult(java.sql.ResultSet rs, java.lang.String columnName)TgetResult(java.sql.CallableStatement cs, int columnIndex)TgetResult(java.sql.ResultSet rs, int columnIndex)TgetResult(java.sql.ResultSet rs, java.lang.String columnName)voidsetConfiguration(Configuration c)Deprecated.Since 3.5.0 - See https://github.com/mybatis/mybatis-3/issues/1203.abstract voidsetNonNullParameter(java.sql.PreparedStatement ps, int i, T parameter, JdbcType jdbcType)voidsetParameter(java.sql.PreparedStatement ps, int i, T parameter, JdbcType jdbcType)-
Methods inherited from class org.apache.ibatis.type.TypeReference
getRawType, toString
-
-
-
-
Field Detail
-
configuration
@Deprecated protected Configuration configuration
Deprecated.Since 3.5.0 - See https://github.com/mybatis/mybatis-3/issues/1203. This field will remove future.
-
-
Method Detail
-
setConfiguration
@Deprecated public void setConfiguration(Configuration c)
Deprecated.Since 3.5.0 - See https://github.com/mybatis/mybatis-3/issues/1203. This property will remove future.
-
setParameter
public void setParameter(java.sql.PreparedStatement ps, int i, T parameter, JdbcType jdbcType) throws java.sql.SQLException- Specified by:
setParameterin interfaceTypeHandler<T>- Throws:
java.sql.SQLException
-
getResult
public T getResult(java.sql.ResultSet rs, java.lang.String columnName) throws java.sql.SQLException
- Specified by:
getResultin interfaceTypeHandler<T>- Throws:
java.sql.SQLException
-
getResult
public T getResult(java.sql.ResultSet rs, int columnIndex) throws java.sql.SQLException
- Specified by:
getResultin interfaceTypeHandler<T>- Throws:
java.sql.SQLException
-
getResult
public T getResult(java.sql.CallableStatement cs, int columnIndex) throws java.sql.SQLException
- Specified by:
getResultin interfaceTypeHandler<T>- Throws:
java.sql.SQLException
-
setNonNullParameter
public abstract void setNonNullParameter(java.sql.PreparedStatement ps, int i, T parameter, JdbcType jdbcType) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getNullableResult
public abstract T getNullableResult(java.sql.ResultSet rs, java.lang.String columnName) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
getNullableResult
public abstract T getNullableResult(java.sql.ResultSet rs, int columnIndex) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
getNullableResult
public abstract T getNullableResult(java.sql.CallableStatement cs, int columnIndex) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
-