org.apache.ojb.broker.accesslayer
Class StatementsForClassImpl

java.lang.Object
  extended by org.apache.ojb.broker.accesslayer.StatementsForClassImpl
All Implemented Interfaces:
StatementsForClassIF

public class StatementsForClassImpl
extends java.lang.Object
implements StatementsForClassIF

This class serves as a cache for Statements that are used for persistence operations on a given class.

Version:
$Id: StatementsForClassImpl.java 365076 2005-10-27 17:33:23Z arminw $
Author:
Thomas Mahler

Constructor Summary
StatementsForClassImpl(JdbcConnectionDescriptor jcd, ClassDescriptor classDescriptor)
           
 
Method Summary
 java.sql.PreparedStatement getDeleteStmt(java.sql.Connection con)
          Returns the DELETE Statement used for clazz.
 java.sql.Statement getGenericStmt(java.sql.Connection con, boolean scrollable)
          Returns a generic unprepared Statement used for clazz.
 java.sql.PreparedStatement getInsertStmt(java.sql.Connection con)
          Returns the INSERT Statement used for clazz.
 java.sql.PreparedStatement getPreparedStmt(java.sql.Connection con, java.lang.String sql, boolean scrollable, int explicitFetchSizeHint, boolean callableStmt)
          Returns a prepared Statement used for clazz.
 java.sql.PreparedStatement getSelectByPKStmt(java.sql.Connection con)
          Returns the SELECT Statement used for clazz.
 java.sql.PreparedStatement getUpdateStmt(java.sql.Connection con)
          Returns the UPDATE Statement used for clazz.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatementsForClassImpl

public StatementsForClassImpl(JdbcConnectionDescriptor jcd,
                              ClassDescriptor classDescriptor)
Method Detail

getDeleteStmt

public java.sql.PreparedStatement getDeleteStmt(java.sql.Connection con)
                                         throws java.sql.SQLException
Description copied from interface: StatementsForClassIF
Returns the DELETE Statement used for clazz.

Specified by:
getDeleteStmt in interface StatementsForClassIF
Returns:
java.sql.PreparedStatement
Throws:
java.sql.SQLException

getGenericStmt

public java.sql.Statement getGenericStmt(java.sql.Connection con,
                                         boolean scrollable)
                                  throws PersistenceBrokerSQLException
Description copied from interface: StatementsForClassIF
Returns a generic unprepared Statement used for clazz. Never use this method for UPDATE/INSERT/DELETE if you want to use the batch mode.

Specified by:
getGenericStmt in interface StatementsForClassIF
Returns:
java.sql.Statement
Throws:
PersistenceBrokerSQLException

getInsertStmt

public java.sql.PreparedStatement getInsertStmt(java.sql.Connection con)
                                         throws java.sql.SQLException
Description copied from interface: StatementsForClassIF
Returns the INSERT Statement used for clazz.

Specified by:
getInsertStmt in interface StatementsForClassIF
Returns:
java.sql.PreparedStatement
Throws:
java.sql.SQLException

getPreparedStmt

public java.sql.PreparedStatement getPreparedStmt(java.sql.Connection con,
                                                  java.lang.String sql,
                                                  boolean scrollable,
                                                  int explicitFetchSizeHint,
                                                  boolean callableStmt)
                                           throws PersistenceBrokerSQLException
Description copied from interface: StatementsForClassIF
Returns a prepared Statement used for clazz.

Specified by:
getPreparedStmt in interface StatementsForClassIF
Returns:
java.sql.Statement
Throws:
PersistenceBrokerSQLException

getSelectByPKStmt

public java.sql.PreparedStatement getSelectByPKStmt(java.sql.Connection con)
                                             throws java.sql.SQLException
Description copied from interface: StatementsForClassIF
Returns the SELECT Statement used for clazz.

Specified by:
getSelectByPKStmt in interface StatementsForClassIF
Returns:
java.sql.PreparedStatement
Throws:
java.sql.SQLException

getUpdateStmt

public java.sql.PreparedStatement getUpdateStmt(java.sql.Connection con)
                                         throws java.sql.SQLException
Description copied from interface: StatementsForClassIF
Returns the UPDATE Statement used for clazz.

Specified by:
getUpdateStmt in interface StatementsForClassIF
Returns:
java.sql.PreparedStatement
Throws:
java.sql.SQLException


(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30