Package io.ebeaninternal.server.type
Class ScalarTypeTimestamp
- java.lang.Object
-
- io.ebeaninternal.server.type.ScalarTypeBase<T>
-
- io.ebeaninternal.server.type.ScalarTypeBaseDateTime<Timestamp>
-
- io.ebeaninternal.server.type.ScalarTypeTimestamp
-
- All Implemented Interfaces:
StringFormatter
,StringParser
,ScalarDataReader<Timestamp>
,ScalarType<Timestamp>
public class ScalarTypeTimestamp extends ScalarTypeBaseDateTime<Timestamp>
ScalarType for java.sql.Timestamp.
-
-
Constructor Summary
Constructors Constructor Description ScalarTypeTimestamp(JsonConfig.DateTime mode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind(DataBind b, Timestamp value)
Convert (if necessary) and bind the value to the preparedStatement.Timestamp
convertFromInstant(Instant ts)
Convert to the value from a Instant.Timestamp
convertFromMillis(long systemTimeMillis)
Convert from epoch millis to the value.Timestamp
convertFromTimestamp(Timestamp ts)
Convert to the value from a Timestamp.long
convertToMillis(Timestamp value)
Convert from the value to epoch millis.Timestamp
convertToTimestamp(Timestamp t)
Convert the value to a Timestamp.Timestamp
read(DataReader dataReader)
Read the value from the resultSet and convert if necessary to the logical bean property value.Timestamp
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, formatValue, getDocType, isDateTimeCapable, jsonRead, jsonWrite, parse, readData, writeData
-
Methods inherited from class io.ebeaninternal.server.type.ScalarTypeBase
format, getJdbcType, getLength, getType, isBinaryType, isDirty, isJdbcNative, isMutable, loadIgnore
-
-
-
-
Constructor Detail
-
ScalarTypeTimestamp
public ScalarTypeTimestamp(JsonConfig.DateTime mode)
-
-
Method Detail
-
convertToMillis
public long convertToMillis(Timestamp value)
Description copied from class:ScalarTypeBaseDateTime
Convert from the value to epoch millis.- Specified by:
convertToMillis
in classScalarTypeBaseDateTime<Timestamp>
-
convertFromMillis
public Timestamp convertFromMillis(long systemTimeMillis)
Description copied from class:ScalarTypeBaseDateTime
Convert from epoch millis to the value.- Specified by:
convertFromMillis
in interfaceScalarType<Timestamp>
- Specified by:
convertFromMillis
in classScalarTypeBaseDateTime<Timestamp>
-
convertFromTimestamp
public Timestamp convertFromTimestamp(Timestamp ts)
Description copied from class:ScalarTypeBaseDateTime
Convert to the value from a Timestamp.- Specified by:
convertFromTimestamp
in classScalarTypeBaseDateTime<Timestamp>
-
convertFromInstant
public Timestamp convertFromInstant(Instant ts)
Description copied from class:ScalarTypeBaseDateTime
Convert to the value from a Instant.- Specified by:
convertFromInstant
in classScalarTypeBaseDateTime<Timestamp>
-
convertToTimestamp
public Timestamp convertToTimestamp(Timestamp t)
Description copied from class:ScalarTypeBaseDateTime
Convert the value to a Timestamp.- Specified by:
convertToTimestamp
in classScalarTypeBaseDateTime<Timestamp>
-
bind
public void bind(DataBind b, Timestamp value) throws SQLException
Description copied from interface:ScalarType
Convert (if necessary) and bind the value to the preparedStatement.value may need to be converted from the logical bean property type to the JDBC type.
- Specified by:
bind
in interfaceScalarType<Timestamp>
- Overrides:
bind
in classScalarTypeBaseDateTime<Timestamp>
- Throws:
SQLException
-
read
public Timestamp read(DataReader dataReader) throws SQLException
Description copied from interface:ScalarType
Read the value from the resultSet and convert if necessary to the logical bean property value.- Specified by:
read
in interfaceScalarDataReader<Timestamp>
- Specified by:
read
in interfaceScalarType<Timestamp>
- Overrides:
read
in classScalarTypeBaseDateTime<Timestamp>
- Throws:
SQLException
-
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 Timestamp 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).
-
-