Class JdbcPreparedStatementCpoData

All Implemented Interfaces:
CpoData

public class JdbcPreparedStatementCpoData extends AbstractStatementCpoData
The data handler for a prepared statement
Author:
dberry
  • Constructor Details

    • JdbcPreparedStatementCpoData

      public JdbcPreparedStatementCpoData(JdbcPreparedStatementFactory cpoStatementFactory, CpoAttribute cpoAttribute, int index)
      Construct a JdbcPreparedStatementCpoData
      Parameters:
      cpoStatementFactory - - The JdbcPreparedStatementFactory
      cpoAttribute - - The CpoAttribute to manage
      index - - The index of the CpoAttribute
  • Method Details

    • 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
    • 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