Class CpoStatementFactory

java.lang.Object
org.synchronoss.cpo.core.CpoStatementFactory
All Implemented Interfaces:
CpoReleasable

public abstract class CpoStatementFactory extends Object implements CpoReleasable
CpoStatementFactory is the base class that encapsulates the creation of the native statement for the target datastore from the meta expression, where clauses, and order-by clauses.
Author:
david berry
  • Constructor Details

    • CpoStatementFactory

      public CpoStatementFactory(org.slf4j.Logger localLogger)
      Constructs a statement factory that logs to the given logger.
      Parameters:
      localLogger - the logger to use for statement-building diagnostics
  • Method Details

    • getLocalLogger

      public org.slf4j.Logger getLocalLogger()
      Gets the logger used for statement-building diagnostics.
      Returns:
      the logger used for statement-building diagnostics
    • AddReleasable

      public void AddReleasable(CpoReleasable releasable)
      Adds a releasable object to this object. The release method on the releasable will be called when the PreparedStatement is executed.
      Parameters:
      releasable - the releasable to register; if null the call is a no-op
    • release

      public void release() throws CpoException
      Called by the CPO framework. This method calls the release on all the CpoReleasable associated with this object
      Specified by:
      release in interface CpoReleasable
      Throws:
      CpoException - An exception occurred
    • getBindValues

      public List<BindAttribute> getBindValues(CpoFunction function, Object obj) throws CpoException
      Called by the CPO Framework. Binds all the attibutes from the class for the CPO meta parameters and the parameters from the dynamic where.
      Parameters:
      function - the meta function whose arguments describe the parameters to bind
      obj - the bean instance to pull argument attribute values from
      Returns:
      the ordered list of bind values for function's arguments
      Throws:
      CpoException - if one of function's arguments is null
    • setBindValues

      public void setBindValues(Collection<BindAttribute> bindValues) throws CpoException
      Called by the CPO Framework. Binds all the attibutes from the class for the CPO meta parameters and the parameters from the dynamic where.
      Parameters:
      bindValues - the bind values to apply to the underlying statement, in parameter order; if null the call is a no-op
      Throws:
      CpoException - if a value could not be bound to the underlying statement