|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.ojb.broker.accesslayer.StatementsForClassImpl
public class StatementsForClassImpl
This class serves as a cache for Statements that are used for persistence operations on a given class.
| Field Summary | |
|---|---|
protected ClassDescriptor |
classDescriptor
sets the escape processing mode |
protected Class |
clazz
|
protected int |
fetchSize
|
protected boolean |
FORCEJDBC1_0
force use of JDBC 1.0 statement creation |
protected Platform |
platform
|
protected SqlGenerator |
sqlGenerator
|
| Constructor Summary | |
|---|---|
StatementsForClassImpl(JdbcConnectionDescriptor jcd,
ClassDescriptor classDescriptor)
|
|
| Method Summary | |
|---|---|
PreparedStatement |
getDeleteStmt(Connection con)
Returns the DELETE Statement used for clazz. |
Statement |
getGenericStmt(Connection con,
boolean scrollable)
Returns a generic unprepared Statement used for clazz. |
PreparedStatement |
getInsertStmt(Connection con)
Returns the INSERT Statement used for clazz. |
PreparedStatement |
getPreparedStmt(Connection con,
String sql,
boolean scrollable,
int explicitFetchSizeHint,
boolean callableStmt)
Returns a prepared Statement used for clazz. |
PreparedStatement |
getSelectByPKStmt(Connection con)
Returns the SELECT Statement used for clazz. |
PreparedStatement |
getUpdateStmt(Connection con)
Returns the UPDATE Statement used for clazz. |
protected PreparedStatement |
prepareStatement(Connection con,
String sql,
boolean scrollable,
boolean createPreparedStatement,
int explicitFetchSizeHint)
Prepares a statement with parameters that should work with most RDBMS. |
protected boolean |
usePreparedDeleteStatement()
Answer true if a PreparedStatement has to be used false for a CallableStatement |
protected boolean |
usePreparedInsertStatement()
Answer true if a PreparedStatement has to be used false for a CallableStatement |
protected boolean |
usePreparedUpdateStatement()
Answer true if a PreparedStatement has to be used false for a CallableStatement |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final ClassDescriptor classDescriptor
protected final SqlGenerator sqlGenerator
protected final Platform platform
protected final Class clazz
protected final int fetchSize
protected boolean FORCEJDBC1_0
| Constructor Detail |
|---|
public StatementsForClassImpl(JdbcConnectionDescriptor jcd,
ClassDescriptor classDescriptor)
| Method Detail |
|---|
protected boolean usePreparedDeleteStatement()
public PreparedStatement getDeleteStmt(Connection con)
throws SQLException
StatementsForClassIF
getDeleteStmt in interface StatementsForClassIFSQLException
public Statement getGenericStmt(Connection con,
boolean scrollable)
throws PersistenceBrokerSQLException
StatementsForClassIF
getGenericStmt in interface StatementsForClassIFPersistenceBrokerSQLExceptionprotected boolean usePreparedInsertStatement()
public PreparedStatement getInsertStmt(Connection con)
throws SQLException
StatementsForClassIF
getInsertStmt in interface StatementsForClassIFSQLException
public PreparedStatement getPreparedStmt(Connection con,
String sql,
boolean scrollable,
int explicitFetchSizeHint,
boolean callableStmt)
throws PersistenceBrokerSQLException
StatementsForClassIF
getPreparedStmt in interface StatementsForClassIFPersistenceBrokerSQLException
public PreparedStatement getSelectByPKStmt(Connection con)
throws SQLException
StatementsForClassIF
getSelectByPKStmt in interface StatementsForClassIFSQLExceptionprotected boolean usePreparedUpdateStatement()
public PreparedStatement getUpdateStmt(Connection con)
throws SQLException
StatementsForClassIF
getUpdateStmt in interface StatementsForClassIFSQLException
protected PreparedStatement prepareStatement(Connection con,
String sql,
boolean scrollable,
boolean createPreparedStatement,
int explicitFetchSizeHint)
throws SQLException
con - the connection to utilizesql - the sql syntax to use when creating the statement.scrollable - determines if the statement will be scrollable.createPreparedStatement - if true, then a
PreparedStatement will be created. If false, then
a CallableStatement will be created.explicitFetchSizeHint - will be used as fetchSize hint
(if applicable) if > 0
sql argument.
SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||