Class TransformClob
java.lang.Object
org.synchronoss.cpo.jdbc.transform.TransformClob
- All Implemented Interfaces:
CpoTransform<Clob,,char[]> JdbcCpoTransform<Clob,char[]>
Converts a java.sql.Clob from a jdbc datasource to a byte[] and from a byte[] to a java.sql.clob
- Author:
- david berry
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchar[]transformIn(Clob clob) Transforms the datasource object into an object required by the classtransformOut(char[] j) Converts a bean attribute's value into the raw datastore-side representation.transformOut(JdbcCallableStatementFactory jpsf, char[] attributeObject) Transforms a java object to a data source object for the preparedstatementtransformOut(JdbcPreparedStatementFactory jpsf, char[] attributeObject) Transforms the data from the class attribute to the object required by the datasource
-
Constructor Details
-
TransformClob
public TransformClob()Construct a TransformClob
-
-
Method Details
-
transformIn
Transforms the datasource object into an object required by the class- Specified by:
transformInin interfaceCpoTransform<Clob,char[]> - Parameters:
clob- The Clob from the database to be transformed into a byte array- Returns:
- The object to be stored in the attribute
- Throws:
CpoException- - An error occurred
-
transformOut
public Clob transformOut(JdbcPreparedStatementFactory jpsf, char[] attributeObject) throws CpoException Transforms the data from the class attribute to the object required by the datasource- Specified by:
transformOutin interfaceJdbcCpoTransform<Clob,char[]> - Parameters:
jpsf- The JdbcPreparedStatementFactory to have access to the actual connection and be able to work with closeable itemsattributeObject- The object that represents the attribute being persisted.- Returns:
- The object to be stored in the datasource
- Throws:
CpoException- if the char array cannot be wrapped as aSerialClob
-
transformOut
public Clob transformOut(JdbcCallableStatementFactory jpsf, char[] attributeObject) throws CpoException, UnsupportedOperationException Description copied from interface:JdbcCpoTransformTransforms a java object to a data source object for the preparedstatement- Specified by:
transformOutin interfaceJdbcCpoTransform<Clob,char[]> - Parameters:
jpsf- the callable statement factory that will be receiving the objectattributeObject- the java object to be transformed- Returns:
- The datasource object
- Throws:
CpoException- an error transforming the java object to the data objectUnsupportedOperationException
-
transformOut
Description copied from interface:CpoTransformConverts a bean attribute's value into the raw datastore-side representation.- Specified by:
transformOutin interfaceCpoTransform<Clob,char[]> - Parameters:
j- the value read from the bean attribute- Returns:
- the value to bind to the datastore
- Throws:
CpoException- if the value cannot be convertedUnsupportedOperationException
-