Package io.ebeaninternal.server.type
Class ScalarTypeUtilDate.DateType
- java.lang.Object
-
- io.ebeaninternal.server.type.ScalarTypeBase<T>
-
- io.ebeaninternal.server.type.ScalarTypeBaseDate<Date>
-
- io.ebeaninternal.server.type.ScalarTypeUtilDate.DateType
-
- All Implemented Interfaces:
StringFormatter
,StringParser
,ScalarDataReader<Date>
,ScalarType<Date>
- Enclosing class:
- ScalarTypeUtilDate
public static class ScalarTypeUtilDate.DateType extends ScalarTypeBaseDate<Date>
-
-
Constructor Summary
Constructors Constructor Description DateType(JsonConfig.Date mode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Date
convertFromDate(Date ts)
Convert from java.sql.Date to the target Date type.Date
convertToDate(Date date)
Convert to java.sql.Date from the target Date type.long
convertToMillis(Date value)
Convert the target value to millis.Date
toBeanType(Object value)
Convert the value as necessary to the logical Bean type.Object
toJdbcType(Object value)
Convert the value as necessary to the JDBC type.-
Methods inherited from class io.ebeaninternal.server.type.ScalarTypeBaseDate
bind, convertFromMillis, formatValue, getDocType, isDateTimeCapable, jsonRead, jsonWrite, parse, read, readData, writeData
-
Methods inherited from class io.ebeaninternal.server.type.ScalarTypeBase
asVersion, format, getJdbcType, getLength, getType, isBinaryType, isDirty, isJdbcNative, isMutable, loadIgnore
-
-
-
-
Constructor Detail
-
DateType
public DateType(JsonConfig.Date mode)
-
-
Method Detail
-
convertToMillis
public long convertToMillis(Date value)
Description copied from class:ScalarTypeBaseDate
Convert the target value to millis.- Specified by:
convertToMillis
in classScalarTypeBaseDate<Date>
-
convertFromDate
public Date convertFromDate(Date ts)
Description copied from class:ScalarTypeBaseDate
Convert from java.sql.Date to the target Date type.- Specified by:
convertFromDate
in classScalarTypeBaseDate<Date>
-
convertToDate
public Date convertToDate(Date date)
Description copied from class:ScalarTypeBaseDate
Convert to java.sql.Date from the target Date type.- Specified by:
convertToDate
in classScalarTypeBaseDate<Date>
-
toJdbcType
public Object toJdbcType(Object value)
Description copied from interface:ScalarType
Convert the value as necessary to the JDBC type.Note that this should also match the type as per the getJdbcType() method.
This is typically used when the matching type is used in a where clause and we use this to ensure it is an appropriate jdbc type.
-
toBeanType
public Date toBeanType(Object value)
Description copied from interface:ScalarType
Convert the value as necessary to the logical Bean type.The type as per the bean property.
This is used to automatically convert id values (typically from a string to a int, long or UUID).
-
-