Package io.ebeaninternal.server.type
Class ScalarTypeJodaDateTime
- java.lang.Object
-
- io.ebeaninternal.server.type.ScalarTypeBase<T>
-
- io.ebeaninternal.server.type.ScalarTypeBaseDateTime<org.joda.time.DateTime>
-
- io.ebeaninternal.server.type.ScalarTypeJodaDateTime
-
- All Implemented Interfaces:
StringFormatter
,StringParser
,ScalarDataReader<org.joda.time.DateTime>
,ScalarType<org.joda.time.DateTime>
public class ScalarTypeJodaDateTime extends ScalarTypeBaseDateTime<org.joda.time.DateTime>
ScalarType for Joda DateTime. This maps to a JDBC Timestamp.
-
-
Constructor Summary
Constructors Constructor Description ScalarTypeJodaDateTime(JsonConfig.DateTime mode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.joda.time.DateTime
convertFromInstant(Instant ts)
Convert to the value from a Instant.org.joda.time.DateTime
convertFromMillis(long systemTimeMillis)
Convert from epoch millis to the value.org.joda.time.DateTime
convertFromTimestamp(Timestamp ts)
Convert to the value from a Timestamp.long
convertToMillis(org.joda.time.DateTime value)
Convert from the value to epoch millis.Timestamp
convertToTimestamp(org.joda.time.DateTime t)
Convert the value to a Timestamp.org.joda.time.DateTime
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.ScalarTypeBaseDateTime
asVersion, bind, formatValue, getDocType, isDateTimeCapable, jsonRead, jsonWrite, parse, read, readData, writeData
-
Methods inherited from class io.ebeaninternal.server.type.ScalarTypeBase
format, getJdbcType, getLength, getType, isBinaryType, isDirty, isJdbcNative, isMutable, loadIgnore
-
-
-
-
Constructor Detail
-
ScalarTypeJodaDateTime
public ScalarTypeJodaDateTime(JsonConfig.DateTime mode)
-
-
Method Detail
-
convertToMillis
public long convertToMillis(org.joda.time.DateTime value)
Description copied from class:ScalarTypeBaseDateTime
Convert from the value to epoch millis.- Specified by:
convertToMillis
in classScalarTypeBaseDateTime<org.joda.time.DateTime>
-
convertFromMillis
public org.joda.time.DateTime convertFromMillis(long systemTimeMillis)
Description copied from class:ScalarTypeBaseDateTime
Convert from epoch millis to the value.- Specified by:
convertFromMillis
in interfaceScalarType<org.joda.time.DateTime>
- Specified by:
convertFromMillis
in classScalarTypeBaseDateTime<org.joda.time.DateTime>
-
convertFromTimestamp
public org.joda.time.DateTime convertFromTimestamp(Timestamp ts)
Description copied from class:ScalarTypeBaseDateTime
Convert to the value from a Timestamp.- Specified by:
convertFromTimestamp
in classScalarTypeBaseDateTime<org.joda.time.DateTime>
-
convertFromInstant
public org.joda.time.DateTime convertFromInstant(Instant ts)
Description copied from class:ScalarTypeBaseDateTime
Convert to the value from a Instant.- Specified by:
convertFromInstant
in classScalarTypeBaseDateTime<org.joda.time.DateTime>
-
convertToTimestamp
public Timestamp convertToTimestamp(org.joda.time.DateTime t)
Description copied from class:ScalarTypeBaseDateTime
Convert the value to a Timestamp.- Specified by:
convertToTimestamp
in classScalarTypeBaseDateTime<org.joda.time.DateTime>
-
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.DateTime 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).
-
-