org.synchronoss.cpo.transform.jdbc
Class TransformTimestampToCalendar

java.lang.Object
  extended by org.synchronoss.cpo.transform.jdbc.TransformTimestampToCalendar
All Implemented Interfaces:
CpoTransform<Timestamp,Calendar>, JdbcCpoTransform<Timestamp,Calendar>

public class TransformTimestampToCalendar
extends Object
implements JdbcCpoTransform<Timestamp,Calendar>

This is an example of a transform that does nothing. It is used to test the mechanics of the transform logic within CPO.

Author:
david berry

Constructor Summary
TransformTimestampToCalendar()
           
 
Method Summary
 Calendar transformIn(Timestamp ts)
          Transforms the java.sql.Timestamp returned from JDBC into a java.util.Calendar to be used by the class.
 Timestamp transformOut(Calendar j)
           
 Timestamp transformOut(JdbcCallableStatementFactory jcsf, Calendar cal)
          Transforms a java.util.Calendar from the CPO Bean into a java.sql.Timestamp to be stored by JDBC
 Timestamp transformOut(JdbcPreparedStatementFactory jpsf, Calendar cal)
          Transforms a java.util.Calendar from the CPO Bean into a java.sql.Timestamp to be stored by JDBC
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransformTimestampToCalendar

public TransformTimestampToCalendar()
Method Detail

transformIn

public Calendar transformIn(Timestamp ts)
                     throws CpoException
Transforms the java.sql.Timestamp returned from JDBC into a java.util.Calendar to be used by the class.

Specified by:
transformIn in interface CpoTransform<Timestamp,Calendar>
Parameters:
ts - The Timestamp from JDBC.
Returns:
A Calendar Object
Throws:
CpoException

transformOut

public Timestamp transformOut(JdbcCallableStatementFactory jcsf,
                              Calendar cal)
                       throws CpoException
Transforms a java.util.Calendar from the CPO Bean into a java.sql.Timestamp to be stored by JDBC

Specified by:
transformOut in interface JdbcCpoTransform<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.
A - Calendar instance
Returns:
A Timestamp object to be stored in the database.
Throws:
CpoException

transformOut

public Timestamp transformOut(JdbcPreparedStatementFactory jpsf,
                              Calendar cal)
                       throws CpoException
Transforms a java.util.Calendar from the CPO Bean into a java.sql.Timestamp to be stored by JDBC

Specified by:
transformOut in interface JdbcCpoTransform<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.
A - Calendar instance
Returns:
A Timestamp object to be stored in the database.
Throws:
CpoException

transformOut

public Timestamp transformOut(Calendar j)
                       throws CpoException,
                              UnsupportedOperationException
Specified by:
transformOut in interface CpoTransform<Timestamp,Calendar>
Throws:
CpoException
UnsupportedOperationException


Copyright © 2014. All Rights Reserved.