org.apache.cayenne.access.trans
Class BatchQueryBuilder

java.lang.Object
  extended by org.apache.cayenne.access.trans.BatchQueryBuilder
Direct Known Subclasses:
DeleteBatchQueryBuilder, InsertBatchQueryBuilder, LOBBatchQueryBuilder, UpdateBatchQueryBuilder

public abstract class BatchQueryBuilder
extends java.lang.Object

Superclass of batch query translators.

Author:
Andriy Shapochka, Andrei Adamchik

Field Summary
protected  DbAdapter adapter
           
protected  java.lang.String trimFunction
           
 
Constructor Summary
BatchQueryBuilder()
           
BatchQueryBuilder(DbAdapter adapter)
           
 
Method Summary
protected  void appendDbAttribute(java.lang.StringBuffer buf, DbAttribute dbAttribute)
          Appends the name of the column to the query buffer.
 void bindParameters(java.sql.PreparedStatement statement, BatchQuery query)
          Binds parameters for the current batch iteration to the PreparedStatement.
 void bindParameters(java.sql.PreparedStatement statement, BatchQuery query, java.util.List dbAttributes)
          Deprecated. since 1.1 use 'bindParameters' without dbAttributes argument.
abstract  java.lang.String createSqlString(BatchQuery batch)
          Translates BatchQuery into an SQL string formatted to use in a PreparedStatement.
 DbAdapter getAdapter()
           
 java.util.List getParameterValues(BatchQuery query)
          Returns a list of values for the current batch iteration.
 java.lang.String getTrimFunction()
           
 void setAdapter(DbAdapter adapter)
           
 void setTrimFunction(java.lang.String string)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

adapter

protected DbAdapter adapter

trimFunction

protected java.lang.String trimFunction
Constructor Detail

BatchQueryBuilder

public BatchQueryBuilder()

BatchQueryBuilder

public BatchQueryBuilder(DbAdapter adapter)
Method Detail

createSqlString

public abstract java.lang.String createSqlString(BatchQuery batch)
Translates BatchQuery into an SQL string formatted to use in a PreparedStatement.


appendDbAttribute

protected void appendDbAttribute(java.lang.StringBuffer buf,
                                 DbAttribute dbAttribute)
Appends the name of the column to the query buffer. Subclasses use this method to append column names in the WHERE clause, i.e. for the columns that are not being updated.


setAdapter

public void setAdapter(DbAdapter adapter)

getAdapter

public DbAdapter getAdapter()

getTrimFunction

public java.lang.String getTrimFunction()

setTrimFunction

public void setTrimFunction(java.lang.String string)

bindParameters

public void bindParameters(java.sql.PreparedStatement statement,
                           BatchQuery query,
                           java.util.List dbAttributes)
                    throws java.sql.SQLException,
                           java.lang.Exception
Deprecated. since 1.1 use 'bindParameters' without dbAttributes argument.

Binds parameters for the current batch iteration to the PreparedStatement.

Throws:
java.sql.SQLException
java.lang.Exception

bindParameters

public void bindParameters(java.sql.PreparedStatement statement,
                           BatchQuery query)
                    throws java.sql.SQLException,
                           java.lang.Exception
Binds parameters for the current batch iteration to the PreparedStatement.

Throws:
java.sql.SQLException
java.lang.Exception
Since:
1.2

getParameterValues

public java.util.List getParameterValues(BatchQuery query)
Returns a list of values for the current batch iteration. Used primarily for logging.

Since:
1.2


Copyright © 2001-2006 Apache.org All Rights Reserved.