Package org.apache.ofbiz.entity.jdbc
Class JdbcValueHandler.TimestampJdbcValueHandler
- java.lang.Object
-
- org.apache.ofbiz.entity.jdbc.JdbcValueHandler<java.sql.Timestamp>
-
- org.apache.ofbiz.entity.jdbc.JdbcValueHandler.TimestampJdbcValueHandler
-
- Enclosing class:
- JdbcValueHandler<T>
protected static class JdbcValueHandler.TimestampJdbcValueHandler extends JdbcValueHandler<java.sql.Timestamp>
Ajava.sql.Timestamp
JDBC value handler.This
JdbcValueHandler
accommodates databases that don't support sub-second precision. If the date-time field type is aCHAR(30)
SQL type,java.sql.Timestamp
s will be stored as JDBC timestamp escape format strings (yyyy-mm-dd hh:mm:ss.fffffffff
), referenced to UTC.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.ofbiz.entity.jdbc.JdbcValueHandler
JdbcValueHandler.ArrayJdbcValueHandler, JdbcValueHandler.BigDecimalJdbcValueHandler, JdbcValueHandler.BlobJdbcValueHandler, JdbcValueHandler.BooleanJdbcValueHandler, JdbcValueHandler.ByteArrayJdbcValueHandler, JdbcValueHandler.ClobJdbcValueHandler, JdbcValueHandler.DateJdbcValueHandler, JdbcValueHandler.DoubleJdbcValueHandler, JdbcValueHandler.FloatJdbcValueHandler, JdbcValueHandler.IntegerJdbcValueHandler, JdbcValueHandler.LongJdbcValueHandler, JdbcValueHandler.ObjectJdbcValueHandler, JdbcValueHandler.RowIdJdbcValueHandler, JdbcValueHandler.ShortJdbcValueHandler, JdbcValueHandler.StringJdbcValueHandler, JdbcValueHandler.TimeJdbcValueHandler, JdbcValueHandler.TimestampJdbcValueHandler
-
-
Field Summary
-
Fields inherited from class org.apache.ofbiz.entity.jdbc.JdbcValueHandler
module
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TimestampJdbcValueHandler(int jdbcType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
castAndSetValue(java.sql.PreparedStatement ps, int parameterIndex, java.sql.Timestamp obj)
Sets a value in aPreparedStatement
.java.lang.Class<java.sql.Timestamp>
getJavaClass()
java.sql.Timestamp
getValue(java.sql.ResultSet rs, int columnIndex)
Returns a value from aResultSet
.protected JdbcValueHandler<java.sql.Timestamp>
newInstance(int sqlType)
Returns a new instance of the object - initialized with the specified SQL type.-
Methods inherited from class org.apache.ofbiz.entity.jdbc.JdbcValueHandler
create, getInstance, getSqlType, parseSqlType, serializeObject, setValue
-
-
-
-
Method Detail
-
getJavaClass
public java.lang.Class<java.sql.Timestamp> getJavaClass()
- Specified by:
getJavaClass
in classJdbcValueHandler<java.sql.Timestamp>
-
castAndSetValue
protected void castAndSetValue(java.sql.PreparedStatement ps, int parameterIndex, java.sql.Timestamp obj) throws java.sql.SQLException
Description copied from class:JdbcValueHandler
Sets a value in aPreparedStatement
. Theobj
argument is converted to the correct data type. Subclasses override this method to castobj
to the correct data type and call the appropriatePreparedStatement.setXxx
method.- Specified by:
castAndSetValue
in classJdbcValueHandler<java.sql.Timestamp>
- Throws:
java.sql.SQLException
-
getValue
public java.sql.Timestamp getValue(java.sql.ResultSet rs, int columnIndex) throws java.sql.SQLException
Description copied from class:JdbcValueHandler
Returns a value from aResultSet
. The returned object is converted to the Java data type specified in the fieldtype file.- Specified by:
getValue
in classJdbcValueHandler<java.sql.Timestamp>
- Parameters:
rs
- the ResultSet objectcolumnIndex
- the column index- Returns:
- get value from result set
- Throws:
java.sql.SQLException
-
newInstance
protected JdbcValueHandler<java.sql.Timestamp> newInstance(int sqlType)
Description copied from class:JdbcValueHandler
Returns a new instance of the object - initialized with the specified SQL type.- Specified by:
newInstance
in classJdbcValueHandler<java.sql.Timestamp>
- Parameters:
sqlType
- the sql type- Returns:
- returns a new instance
-
-