Class TransformNoOp
java.lang.Object
org.synchronoss.cpo.cassandra.transform.TransformNoOp
- All Implemented Interfaces:
CassandraCpoTransform<Integer,,Integer> CpoTransform<Integer,Integer>
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptiontransformIn(Integer dbIn) Transforms the datasource object into an object required by the class.Converts a bean attribute's value into the raw datastore-side representation.transformOut(CassandraBoundStatementFactory cbsf, Integer attrOut) Transforms the data from the class attribute to the object required by the datasource.
-
Constructor Details
-
TransformNoOp
public TransformNoOp()Create a TransformNoOp
-
-
Method Details
-
transformIn
Transforms the datasource object into an object required by the class. The type of the dbIn parameter and the type of the return value must change to match the types being converted. Reflection is used to true everything up at runtime.e.g public byte[] transformIn(Blob dbIn) would be the signature for converting a Blob to a byte[] to be stored in the bean.
- Specified by:
transformInin interfaceCpoTransform<Integer,Integer> - Parameters:
dbIn- The value from the datasource that will be transformed into the format that is required by the bean.- Returns:
- The object to be stored in the attribute
- Throws:
CpoException- An error occurred
-
transformOut
public Integer transformOut(CassandraBoundStatementFactory cbsf, Integer attrOut) throws CpoException Transforms the data from the class attribute to the object required by the datasource. The type of the attrOut parameter and the type of the return value must change to match the types being converted. Reflection is used to true everything up at runtime.e.g public ByteBuffer transformOut(CassandraBoundStatementFactory cbsf, byte[] attrOut) would be the signature for converting a byte[] stored in the bean into a ByteBuffer for the datasource.
- Specified by:
transformOutin interfaceCassandraCpoTransform<Integer,Integer> - Parameters:
cbsf- a reference to the CassandraBoundStatementFactory. This is necessary for Transforms that need access to the bound statement/session to deal with certain datatypes.attrOut- The attribute object that needs to get transformed into the db representation- Returns:
- The object to be stored in the datasource
- Throws:
CpoException- An error occurred
-
transformOut
Description copied from interface:CpoTransformConverts a bean attribute's value into the raw datastore-side representation.- Specified by:
transformOutin interfaceCpoTransform<Integer,Integer> - 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
-