Class TransformTimestampToCalendar
java.lang.Object
org.synchronoss.cpo.jdbc.transform.TransformTimestampToCalendar
- All Implemented Interfaces:
CpoTransform<Timestamp,,Calendar> JdbcCpoTransform<Timestamp,Calendar>
public class TransformTimestampToCalendar
extends Object
implements JdbcCpoTransform<Timestamp,Calendar>
Converts a
java.sql.Timestamp from a jdbc datasource to a java.util.Calendar and
from a java.util.Calendar to a java.sql.Timestamp in a datasource.- Author:
- david berry
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiontransformIn(Timestamp ts) Transforms the Timestamp to a Calendarjava.sql.Timestampreturned from JDBC into ajava.util.Calendarto be used by the class.transformOut(JdbcCallableStatementFactory jcsf, Calendar cal) Transforms a calendar to a sql timestampjava.util.Calendarfrom the CPO Bean into ajava.sql.Timestampto be stored by JDBCtransformOut(JdbcPreparedStatementFactory jpsf, Calendar cal) Transforms a calendar to a sql timestampjava.util.Calendarfrom the CPO Bean into ajava.sql.Timestampto be stored by JDBC
-
Constructor Details
-
TransformTimestampToCalendar
public TransformTimestampToCalendar()Construct a TransformTimestampToCalendar
-
-
Method Details
-
transformIn
Transforms the Timestamp to a Calendarjava.sql.Timestampreturned from JDBC into ajava.util.Calendarto be used by the class.- Specified by:
transformInin interfaceCpoTransform<Timestamp,Calendar> - Parameters:
ts- The Timestamp from JDBC.- Returns:
- A Calendar Object
- Throws:
CpoException- - an error occurred
-
transformOut
Transforms a calendar to a sql timestampjava.util.Calendarfrom the CPO Bean into ajava.sql.Timestampto be stored by JDBC- Specified by:
transformOutin interfaceJdbcCpoTransform<Timestamp,Calendar> - Parameters:
jcsf- a reference to the JdbcCallableStatementFactory. This is necessary as some DBMSs (ORACLE) that require access to the connection to deal with certain datatypes.cal- A Calendar instance- Returns:
- A Timestamp object to be stored in the database.
- Throws:
CpoException- - an error occurred
-
transformOut
Transforms a calendar to a sql timestampjava.util.Calendarfrom the CPO Bean into ajava.sql.Timestampto be stored by JDBC- Specified by:
transformOutin interfaceJdbcCpoTransform<Timestamp,Calendar> - Parameters:
jpsf- a reference to the JdbcPreparedStatementFactory. This is necessary as some DBMSs (ORACLE) that require access to the connection to deal with certain datatypes.cal- A Calendar instance- Returns:
- A Timestamp object to be stored in the database.
- Throws:
CpoException- - an error occurred
-
transformOut
- Specified by:
transformOutin interfaceCpoTransform<Timestamp,Calendar> - Throws:
CpoExceptionUnsupportedOperationException
-