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