Class ScalarTypeBaseDate<T>

    • Method Detail

      • convertToMillis

        public abstract long convertToMillis​(T value)
        Convert the target value to millis.
      • convertToDate

        public abstract Date convertToDate​(T t)
        Convert to java.sql.Date from the target Date type.
      • convertFromDate

        public abstract T convertFromDate​(Date ts)
        Convert from java.sql.Date to the target Date type.
      • bind

        public void bind​(DataBind b,
                         T value)
                  throws SQLException
        Description copied from interface: ScalarType
        Convert (if necessary) and bind the value to the preparedStatement.

        value may need to be converted from the logical bean property type to the JDBC type.

        Throws:
        SQLException
      • formatValue

        public String formatValue​(T t)
        Description copied from interface: ScalarType
        Convert the type into a string representation.

        Reciprocal of parse().

      • parse

        public T parse​(String value)
        Description copied from interface: ScalarType
        Convert the string value to the appropriate java object.

        Mostly used to support CSV, JSON and XML parsing.

        Reciprocal of formatValue().

      • convertFromMillis

        public T convertFromMillis​(long systemTimeMillis)
        Description copied from interface: ScalarType
        Convert the systemTimeMillis into the appropriate java object.

        For non dateTime types this will throw an exception.

      • isDateTimeCapable

        public boolean isDateTimeCapable()
        Description copied from interface: ScalarType
        Return true if the type can accept long systemTimeMillis input.

        This is used to determine if is is sensible to use the ScalarType.convertFromMillis(long) method.

        This includes the Date, Calendar, sql Date, Time, Timestamp, JODA types as well as Long, BigDecimal and String (although it generally is not expected to parse systemTimeMillis to a String or BigDecimal).

      • jsonWrite

        public void jsonWrite​(com.fasterxml.jackson.core.JsonGenerator writer,
                              T value)
                       throws IOException
        Description copied from interface: ScalarType
        Write the value to the JsonGenerator.
        Throws:
        IOException