Class YearMonthTypeHandler

  • All Implemented Interfaces:
    TypeHandler<java.time.YearMonth>

    public class YearMonthTypeHandler
    extends BaseTypeHandler<java.time.YearMonth>
    Type Handler for YearMonth.

    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
    • Constructor Detail

      • YearMonthTypeHandler

        public YearMonthTypeHandler()
    • Method Detail

      • setNonNullParameter

        public void setNonNullParameter​(java.sql.PreparedStatement ps,
                                        int i,
                                        java.time.YearMonth yearMonth,
                                        JdbcType jt)
                                 throws java.sql.SQLException
        Specified by:
        setNonNullParameter in class BaseTypeHandler<java.time.YearMonth>
        Throws:
        java.sql.SQLException
      • getNullableResult

        public java.time.YearMonth getNullableResult​(java.sql.ResultSet rs,
                                                     java.lang.String columnName)
                                              throws java.sql.SQLException
        Description copied from class: BaseTypeHandler
        Gets the nullable result.
        Specified by:
        getNullableResult in class BaseTypeHandler<java.time.YearMonth>
        Parameters:
        rs - the rs
        columnName - Colunm name, when configuration useColumnLabel is false
        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:
        getNullableResult in class BaseTypeHandler<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:
        getNullableResult in class BaseTypeHandler<java.time.YearMonth>
        Throws:
        java.sql.SQLException