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