Class CassandraBoundStatementCpoData

All Implemented Interfaces:
CpoData

public class CassandraBoundStatementCpoData extends AbstractBindableCpoData
Helps manage data transfer between the CPO object and the Cassandra bound statement. Bind values are actually applied in CassandraBoundStatementFactory.setBindValues(java.util.Collection<org.synchronoss.cpo.core.BindAttribute>), which builds the whole value array and binds it in a single PreparedStatement.bind(Object...) call; this class only supplies the transform half of the contract (see transformOut(Object)), used to resolve each attribute's value before it goes into that array.
Author:
dberry
  • Constructor Details

    • CassandraBoundStatementCpoData

      public CassandraBoundStatementCpoData(CassandraBoundStatementFactory cpoStatementFactory, CpoAttribute cpoAttribute, int index)
      Constructs the CassandraBoundStatementCpoData
      Parameters:
      cpoStatementFactory - The CassandraBoundStatementFactory
      cpoAttribute - The CpoAttribute
      index - The index of the attribute in the bound statement
  • Method Details

    • transformOut

      public Object transformOut(Object attributeObject) throws CpoException
      Description copied from class: AbstractCpoData
      Transforms a value read from the bean attribute into the form expected by the datastore, applying the attribute's configured transform (if any).

      Applies the attribute's configured CpoTransform, if any; otherwise returns the value unchanged.

      Specified by:
      transformOut in interface CpoData
      Overrides:
      transformOut in class AbstractCpoData
      Parameters:
      attributeObject - the raw value read from the bean's getter
      Returns:
      the value to bind to the datastore statement, transformed if a transform is configured
      Throws:
      CpoException - if the transform fails