Package org.apache.ibatis.type
Class YearMonthTypeHandler
- java.lang.Object
-
- org.apache.ibatis.type.TypeReference<T>
-
- org.apache.ibatis.type.BaseTypeHandler<java.time.YearMonth>
-
- org.apache.ibatis.type.YearMonthTypeHandler
-
- All Implemented Interfaces:
TypeHandler<java.time.YearMonth>
public class YearMonthTypeHandler extends BaseTypeHandler<java.time.YearMonth>
Type Handler forYearMonth.YearMonthTypeHandler relies upon
YearMonth.parse. Therefore column values are expected as strings. The format must be uuuu-MM. Example: "2016-08"- Since:
- 3.4.5
-
-
Field Summary
-
Fields inherited from class org.apache.ibatis.type.BaseTypeHandler
configuration
-
-
Constructor Summary
Constructors Constructor Description YearMonthTypeHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.time.YearMonthgetNullableResult(java.sql.CallableStatement cs, int columnIndex)java.time.YearMonthgetNullableResult(java.sql.ResultSet rs, int columnIndex)java.time.YearMonthgetNullableResult(java.sql.ResultSet rs, java.lang.String columnName)Gets the nullable result.voidsetNonNullParameter(java.sql.PreparedStatement ps, int i, java.time.YearMonth yearMonth, JdbcType jt)private java.time.YearMonthtoYearMonth(java.lang.String value)-
Methods inherited from class org.apache.ibatis.type.BaseTypeHandler
getResult, getResult, getResult, setConfiguration, setParameter
-
Methods inherited from class org.apache.ibatis.type.TypeReference
getRawType, getSuperclassTypeParameter, toString
-
-
-
-
Method Detail
-
setNonNullParameter
public void setNonNullParameter(java.sql.PreparedStatement ps, int i, java.time.YearMonth yearMonth, JdbcType jt) throws java.sql.SQLException- Specified by:
setNonNullParameterin classBaseTypeHandler<java.time.YearMonth>- Throws:
java.sql.SQLException
-
getNullableResult
public java.time.YearMonth getNullableResult(java.sql.ResultSet rs, java.lang.String columnName) throws java.sql.SQLExceptionDescription copied from class:BaseTypeHandlerGets the nullable result.- Specified by:
getNullableResultin classBaseTypeHandler<java.time.YearMonth>- Parameters:
rs- the rscolumnName- Column name, when configurationuseColumnLabelisfalse- Returns:
- the nullable result
- Throws:
java.sql.SQLException- the SQL exception
-
getNullableResult
public java.time.YearMonth getNullableResult(java.sql.ResultSet rs, int columnIndex) throws java.sql.SQLException- Specified by:
getNullableResultin classBaseTypeHandler<java.time.YearMonth>- Throws:
java.sql.SQLException
-
getNullableResult
public java.time.YearMonth getNullableResult(java.sql.CallableStatement cs, int columnIndex) throws java.sql.SQLException- Specified by:
getNullableResultin classBaseTypeHandler<java.time.YearMonth>- Throws:
java.sql.SQLException
-
toYearMonth
private java.time.YearMonth toYearMonth(java.lang.String value)
-
-