org.synchronoss.cpo.jdbc
Class JdbcPreparedStatementFactory

Package class diagram package JdbcPreparedStatementFactory
java.lang.Object
  extended by org.synchronoss.cpo.jdbc.JdbcPreparedStatementFactory
All Implemented Interfaces:
CpoReleasible

public class JdbcPreparedStatementFactory
extends java.lang.Object
implements CpoReleasible

JdbcPreparedStatementFactory is the object that encapsulates the creation of the actual PreparedStatement for the JDBC driver.

Author:
david berry

Constructor Summary
JdbcPreparedStatementFactory(java.sql.Connection conn, JdbcCpoAdapter jca, JdbcMetaClass<T> jmcCriteria, JdbcQuery jq, T obj)
          Used to build the PreparedStatement that is used by CPO to create the actual JDBC PreparedStatement.
JdbcPreparedStatementFactory(java.sql.Connection conn, JdbcCpoAdapter jca, JdbcMetaClass<T> jmcCriteria, JdbcQuery jq, T obj, java.util.Collection<CpoWhere> wheres, java.util.Collection<CpoOrderBy> orderBy, java.util.Collection<CpoNativeQuery> nativeQueries)
          Used to build the PreparedStatement that is used by CPO to create the actual JDBC PreparedStatement.
 
Method Summary
 void AddReleasible(CpoReleasible releasible)
          Adds a releasible object to this object.
protected  java.util.List<BindAttribute> getBindValues(JdbcQuery jq, java.lang.Object obj)
          Called by the CPO Framework.
 java.sql.PreparedStatement getPreparedStatement()
          Returns the jdbc prepared statment associated with this object
 void release()
          Called by the CPO framework.
protected  void setBindValues(java.util.Collection<BindAttribute> bindValues)
          Called by the CPO Framework.
protected  void setPreparedStatement(java.sql.PreparedStatement ps)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcPreparedStatementFactory

public JdbcPreparedStatementFactory(java.sql.Connection conn,
                                    JdbcCpoAdapter jca,
                                    JdbcMetaClass<T> jmcCriteria,
                                    JdbcQuery jq,
                                    T obj)
                             throws CpoException
Used to build the PreparedStatement that is used by CPO to create the actual JDBC PreparedStatement. The constructor is called by the internal CPO framework. This is not to be used by users of CPO. Programmers that build Transforms may need to use this object to get access to the actual connection.

Parameters:
conn - The actual jdbc connection that will be used to create the callable statement.
jca - The JdbcCpoAdapter that is controlling this transaction
jq - The JdbcQuery that is being executed
obj - The pojo that is being acted upon
Throws:
CpoException - if a CPO error occurs
java.sql.SQLException - if a JDBC error occurs

JdbcPreparedStatementFactory

public JdbcPreparedStatementFactory(java.sql.Connection conn,
                                    JdbcCpoAdapter jca,
                                    JdbcMetaClass<T> jmcCriteria,
                                    JdbcQuery jq,
                                    T obj,
                                    java.util.Collection<CpoWhere> wheres,
                                    java.util.Collection<CpoOrderBy> orderBy,
                                    java.util.Collection<CpoNativeQuery> nativeQueries)
                             throws CpoException
Used to build the PreparedStatement that is used by CPO to create the actual JDBC PreparedStatement. The constructor is called by the internal CPO framework. This is not to be used by users of CPO. Programmers that build Transforms may need to use this object to get access to the actual connection.

Parameters:
conn - The actual jdbc connection that will be used to create the callable statement.
jca - The JdbcCpoAdapter that is controlling this transaction
jq - The JdbcQuery that is being executed
obj - The pojo that is being acted upon
additionalSql - Additional sql to be appended to the JdbcQuery sql that is used to create the actual JDBC PreparedStatement
Throws:
CpoException - if a CPO error occurs
java.sql.SQLException - if a JDBC error occurs
Method Detail

getPreparedStatement

public java.sql.PreparedStatement getPreparedStatement()
Returns the jdbc prepared statment associated with this object


setPreparedStatement

protected void setPreparedStatement(java.sql.PreparedStatement ps)

AddReleasible

public void AddReleasible(CpoReleasible releasible)
Adds a releasible object to this object. The release method on the releasible will be called when the PreparedStatement is executed.


release

public void release()
             throws CpoException
Called by the CPO framework. This method calls the release on all the CpoReleasible associated with this object

Specified by:
release in interface CpoReleasible
Throws:
CpoException

getBindValues

protected java.util.List<BindAttribute> getBindValues(JdbcQuery jq,
                                                      java.lang.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.

Throws:
CpoException

setBindValues

protected void setBindValues(java.util.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.

Throws:
CpoException


Copyright © 2010. All Rights Reserved.