com.triactive.jdo.store
Class SqlTimestampMapping
java.lang.Object
com.triactive.jdo.store.Mapping
com.triactive.jdo.store.ColumnMapping
com.triactive.jdo.store.SqlTimestampMapping
- Direct Known Subclasses:
- DateMapping, SqlTimestampCharMapping
public class SqlTimestampMapping
- extends ColumnMapping
Method Summary |
java.lang.Object |
getObject(PersistenceManager pm,
java.sql.ResultSet rs,
int param)
|
protected java.sql.Timestamp |
getTimestamp(java.sql.ResultSet rs,
int param)
|
protected TypeInfo |
getTypeInfo()
|
protected void |
initTypeInfo()
|
SQLExpression |
newSQLExpression(QueryStatement qs,
QueryStatement.QueryColumn qsc,
java.lang.String fieldName)
|
SQLExpression |
newSQLLiteral(QueryStatement qs,
java.lang.Object value)
|
void |
setObject(PersistenceManager pm,
java.sql.PreparedStatement ps,
int param,
java.lang.Object value)
|
static java.sql.Timestamp |
stringToTimestamp(java.lang.String s,
java.util.Calendar cal)
Converts a string in JDBC timestamp escape format to a
java.sql.Timestamp object using the "UTC" time zone. |
static java.lang.String |
timestampToString(java.sql.Timestamp ts,
java.util.Calendar cal)
Formats a timestamp in JDBC timestamp escape format using the "UTC" time
zone. |
Methods inherited from class com.triactive.jdo.store.Mapping |
failureMessage, getBoolean, getByte, getChar, getDouble, getFloat, getInt, getLong, getShort, getString, getType, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setShort, setString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
SqlTimestampMapping
public SqlTimestampMapping(DatabaseAdapter dba,
java.lang.Class type)
SqlTimestampMapping
public SqlTimestampMapping(Column col)
SqlTimestampMapping
public SqlTimestampMapping(ClassBaseTable table,
int relativeFieldNumber)
getTypeInfo
protected TypeInfo getTypeInfo()
- Specified by:
getTypeInfo
in class ColumnMapping
initTypeInfo
protected void initTypeInfo()
- Overrides:
initTypeInfo
in class ColumnMapping
setObject
public void setObject(PersistenceManager pm,
java.sql.PreparedStatement ps,
int param,
java.lang.Object value)
- Overrides:
setObject
in class Mapping
getTimestamp
protected java.sql.Timestamp getTimestamp(java.sql.ResultSet rs,
int param)
getObject
public java.lang.Object getObject(PersistenceManager pm,
java.sql.ResultSet rs,
int param)
- Overrides:
getObject
in class Mapping
newSQLLiteral
public SQLExpression newSQLLiteral(QueryStatement qs,
java.lang.Object value)
- Specified by:
newSQLLiteral
in class Mapping
newSQLExpression
public SQLExpression newSQLExpression(QueryStatement qs,
QueryStatement.QueryColumn qsc,
java.lang.String fieldName)
- Specified by:
newSQLExpression
in class Mapping
stringToTimestamp
public static java.sql.Timestamp stringToTimestamp(java.lang.String s,
java.util.Calendar cal)
- Converts a string in JDBC timestamp escape format to a
java.sql.Timestamp object using the "UTC" time zone.
- Parameters:
s
- Timestamp string in format
yyyy-mm-dd hh:mm:ss.fffffffff.
- Returns:
- Corresponding java.sql.Timestamp value.
- Throws:
java.lang.IllegalArgumentException
- If the given argument does not have the format
yyyy-mm-dd hh:mm:ss.fffffffff.- See Also:
Timestamp
timestampToString
public static java.lang.String timestampToString(java.sql.Timestamp ts,
java.util.Calendar cal)
- Formats a timestamp in JDBC timestamp escape format using the "UTC" time
zone.
- Parameters:
ts
- The timestamp to be formatted.
- Returns:
- A String in yyyy-mm-dd hh:mm:ss.fffffffff format.
- See Also:
Timestamp
Copyright ? 2001 TriActive, Inc. All Rights Reserved.