Package io.ebeaninternal.server.type
Class ScalarTypeJodaDateMidnight
- java.lang.Object
-
- io.ebeaninternal.server.type.ScalarTypeBase<T>
-
- io.ebeaninternal.server.type.ScalarTypeBaseDate<org.joda.time.DateMidnight>
-
- io.ebeaninternal.server.type.ScalarTypeJodaDateMidnight
-
- All Implemented Interfaces:
StringFormatter
,StringParser
,ScalarDataReader<org.joda.time.DateMidnight>
,ScalarType<org.joda.time.DateMidnight>
public class ScalarTypeJodaDateMidnight extends ScalarTypeBaseDate<org.joda.time.DateMidnight>
ScalarType for Joda DateMidnight. This maps to a JDBC Date.
-
-
Constructor Summary
Constructors Constructor Description ScalarTypeJodaDateMidnight(JsonConfig.Date mode)
Instantiates a new scalar type joda date midnight.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.joda.time.DateMidnight
convertFromDate(Date ts)
Convert from java.sql.Date to the target Date type.Date
convertToDate(org.joda.time.DateMidnight t)
Convert to java.sql.Date from the target Date type.long
convertToMillis(org.joda.time.DateMidnight value)
Convert the target value to millis.org.joda.time.DateMidnight
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
-
ScalarTypeJodaDateMidnight
public ScalarTypeJodaDateMidnight(JsonConfig.Date mode)
Instantiates a new scalar type joda date midnight.
-
-
Method Detail
-
convertToMillis
public long convertToMillis(org.joda.time.DateMidnight value)
Description copied from class:ScalarTypeBaseDate
Convert the target value to millis.- Specified by:
convertToMillis
in classScalarTypeBaseDate<org.joda.time.DateMidnight>
-
convertFromDate
public org.joda.time.DateMidnight convertFromDate(Date ts)
Description copied from class:ScalarTypeBaseDate
Convert from java.sql.Date to the target Date type.- Specified by:
convertFromDate
in classScalarTypeBaseDate<org.joda.time.DateMidnight>
-
convertToDate
public Date convertToDate(org.joda.time.DateMidnight t)
Description copied from class:ScalarTypeBaseDate
Convert to java.sql.Date from the target Date type.- Specified by:
convertToDate
in classScalarTypeBaseDate<org.joda.time.DateMidnight>
-
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 org.joda.time.DateMidnight 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).
-
-