Class CallableStatementCpoData

All Implemented Interfaces:
CpoData

public class CallableStatementCpoData extends AbstractStatementCpoData
Moves a bound attribute's value to or from a JDBC CallableStatement IN/OUT parameter, applying any configured JdbcCpoTransform along the way.
Author:
dberry
  • Constructor Details

    • CallableStatementCpoData

      public CallableStatementCpoData(CallableStatement cs, CpoAttribute cpoAttribute, int index)
      Constructs a CallableStatementCpoData
      Parameters:
      cs - - The callable statement
      cpoAttribute - - The attribute to add.
      index - - The index of the attribute in the callable statement
    • CallableStatementCpoData

      public CallableStatementCpoData(JdbcCallableStatementFactory jcsf, CpoAttribute cpoAttribute, int index)
      Constructs a CallableStatementCpoData
      Parameters:
      jcsf - - The factory for building the callable statement
      cpoAttribute - - The attribute to add.
      index - - The index of the attribute in the callable 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
    • invokeGetter

      public Object invokeGetter() throws CpoException
      Description copied from class: AbstractCpoData
      Invokes the bean's getter for the bound attribute.

      Not implemented by this base class; subclasses that support reflective getter invocation must override this method.

      Specified by:
      invokeGetter in interface CpoData
      Overrides:
      invokeGetter in class AbstractCpoData
      Returns:
      the value returned by the attribute's getter
      Throws:
      CpoException - if the getter cannot be invoked
    • invokeSetter

      public void invokeSetter(Object instanceObject) throws CpoException
      Description copied from class: AbstractCpoData
      Invokes the bean's setter for the bound attribute.

      Not implemented by this base class; subclasses that support reflective setter invocation must override this method.

      Specified by:
      invokeSetter in interface CpoData
      Overrides:
      invokeSetter in class AbstractCpoData
      Parameters:
      instanceObject - the value to pass to the attribute's setter
      Throws:
      CpoException - if the setter cannot be invoked