Interface CpoData

All Known Implementing Classes:
AbstractBindableCpoData, AbstractCpoData, AbstractStatementCpoData, CallableStatementCpoData, CassandraBoundStatementCpoData, CassandraResultSetCpoData, JdbcPreparedStatementCpoData, JdbcResultSetCpoData, ResultSetCpoData

public interface CpoData
CpoData is the binding between a single bean attribute and the mechanics needed to move its value into and out of the datastore: invoking the bean's getter/setter reflectively and applying any configured CpoTransform on the way in or out.
Author:
dberry
  • Method Summary

    Modifier and Type
    Method
    Description
    Invokes the bean's getter for the bound attribute.
    void
    invokeSetter(Object instanceObject)
    Invokes the bean's setter for the bound attribute.
    transformIn(Object datasourceObject)
    Transforms a value read from the datastore into the form expected by the bean attribute, applying the attribute's configured transform (if any).
    transformOut(Object attributeObject)
    Transforms a value read from the bean attribute into the form expected by the datastore, applying the attribute's configured transform (if any).
  • Method Details

    • invokeGetter

      Object invokeGetter() throws CpoException
      Invokes the bean's getter for the bound attribute.
      Returns:
      the value returned by the attribute's getter
      Throws:
      CpoException - if the getter cannot be invoked
    • invokeSetter

      void invokeSetter(Object instanceObject) throws CpoException
      Invokes the bean's setter for the bound attribute.
      Parameters:
      instanceObject - the value to pass to the attribute's setter
      Throws:
      CpoException - if the setter cannot be invoked
    • transformIn

      Object transformIn(Object datasourceObject) throws CpoException
      Transforms a value read from the datastore into the form expected by the bean attribute, applying the attribute's configured transform (if any).
      Parameters:
      datasourceObject - the raw value read from the datastore
      Returns:
      the value to pass to the bean's setter, transformed if a transform is configured
      Throws:
      CpoException - if the transform fails
    • transformOut

      Object transformOut(Object attributeObject) throws CpoException
      Transforms a value read from the bean attribute into the form expected by the datastore, applying the attribute's configured transform (if any).
      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