Package io.ebeaninternal.server.type
Class ScalarTypeDurationWithNanos
- java.lang.Object
-
- io.ebeaninternal.server.type.ScalarTypeBase<Duration>
-
- io.ebeaninternal.server.type.ScalarTypeDuration
-
- io.ebeaninternal.server.type.ScalarTypeDurationWithNanos
-
- All Implemented Interfaces:
StringFormatter
,StringParser
,ScalarDataReader<Duration>
,ScalarType<Duration>
public class ScalarTypeDurationWithNanos extends ScalarTypeDuration
ScalarType for java.time.Duration (with Nanos precision).Stored in the DB as DECIMAL value.
-
-
Constructor Summary
Constructors Constructor Description ScalarTypeDurationWithNanos()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind(DataBind bind, Duration value)
Convert (if necessary) and bind the value to the preparedStatement.Duration
read(DataReader dataReader)
Read the value from the resultSet and convert if necessary to the logical bean property value.Duration
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.ScalarTypeDuration
convertFromBigDecimal, convertFromMillis, convertToBigDecimal, formatValue, getDocType, isDateTimeCapable, jsonRead, jsonWrite, parse, readData, writeData
-
Methods inherited from class io.ebeaninternal.server.type.ScalarTypeBase
asVersion, format, getJdbcType, getLength, getType, isBinaryType, isDirty, isJdbcNative, isMutable, loadIgnore
-
-
-
-
Constructor Detail
-
ScalarTypeDurationWithNanos
public ScalarTypeDurationWithNanos()
-
-
Method Detail
-
bind
public void bind(DataBind bind, Duration 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<Duration>
- Overrides:
bind
in classScalarTypeDuration
- Throws:
SQLException
-
read
public Duration 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<Duration>
- Specified by:
read
in interfaceScalarType<Duration>
- Overrides:
read
in classScalarTypeDuration
- 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.
- Specified by:
toJdbcType
in interfaceScalarType<Duration>
- Overrides:
toJdbcType
in classScalarTypeDuration
-
toBeanType
public Duration 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).
- Specified by:
toBeanType
in interfaceScalarType<Duration>
- Overrides:
toBeanType
in classScalarTypeDuration
-
-