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