|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.ojb.broker.accesslayer.StatementManager
public class StatementManager
manages JDBC Connection and Statement resources.
| Field Summary |
|---|
| Fields inherited from interface org.apache.ojb.broker.accesslayer.StatementManagerIF |
|---|
FETCH_SIZE_NOT_APPLICABLE, FETCH_SIZE_NOT_EXPLICITLY_SET |
| Constructor Summary | |
|---|---|
StatementManager(PersistenceBroker pBroker)
|
|
| Method Summary | |
|---|---|
void |
bindDelete(PreparedStatement stmt,
ClassDescriptor cld,
Object obj)
binds the objects primary key and locking values to the statement, BRJ |
void |
bindDelete(PreparedStatement stmt,
Identity oid,
ClassDescriptor cld)
binds the Identities Primary key values to the statement |
void |
bindInsert(PreparedStatement stmt,
ClassDescriptor cld,
Object obj)
binds the values of the object obj to the statements parameters |
void |
bindSelect(PreparedStatement stmt,
Identity oid,
ClassDescriptor cld,
boolean callableStmt)
Binds the Identities Primary key values to the statement. |
protected int |
bindStatement(PreparedStatement stmt,
Criteria crit,
ClassDescriptor cld,
int param)
bind a Query based Select Statement |
int |
bindStatement(PreparedStatement stmt,
Query query,
ClassDescriptor cld,
int param)
bind a Query based Select Statement |
void |
bindUpdate(PreparedStatement stmt,
ClassDescriptor cld,
Object obj)
binds the values of the object obj to the statements parameters |
int |
bindValues(PreparedStatement stmt,
ValueContainer[] values,
int index)
binds the given array of values (if not null) starting from the given parameter index |
void |
closeResources(Statement stmt,
ResultSet rs)
|
protected ValueContainer[] |
getAllValues(ClassDescriptor cld,
Object obj)
returns an array containing values for all the Objects attribute |
PreparedStatement |
getDeleteStatement(ClassDescriptor cld)
return a prepared DELETE Statement fitting for the given ClassDescriptor |
Statement |
getGenericStatement(ClassDescriptor cds,
boolean scrollable)
return a generic Statement for the given ClassDescriptor. |
PreparedStatement |
getInsertStatement(ClassDescriptor cds)
return a prepared Insert Statement fitting for the given ClassDescriptor |
protected ValueContainer[] |
getKeyValues(PersistenceBroker broker,
ClassDescriptor cld,
Identity oid)
returns an Array with an Identities PK VALUES |
protected ValueContainer[] |
getKeyValues(PersistenceBroker broker,
ClassDescriptor cld,
Object obj)
returns an Array with an Objects PK VALUES |
protected ValueContainer[] |
getNonKeyValues(PersistenceBroker broker,
ClassDescriptor cld,
Object obj)
returns an Array with an Objects NON-PK VALUES |
PreparedStatement |
getPreparedStatement(ClassDescriptor cds,
String sql,
boolean scrollable,
int explicitFetchSizeHint,
boolean callableStmt)
return a generic Statement for the given ClassDescriptor |
PreparedStatement |
getSelectByPKStatement(ClassDescriptor cds)
return a prepared Select Statement for the given ClassDescriptor |
PreparedStatement |
getUpdateStatement(ClassDescriptor cds)
return a prepared Update Statement fitting to the given ClassDescriptor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StatementManager(PersistenceBroker pBroker)
| Method Detail |
|---|
public void closeResources(Statement stmt,
ResultSet rs)
closeResources in interface StatementManagerIF
public void bindDelete(PreparedStatement stmt,
Identity oid,
ClassDescriptor cld)
throws SQLException
bindDelete in interface StatementManagerIFcld - ClassDescriptor for the Object, if null will be lookup automatic
SQLException
public void bindDelete(PreparedStatement stmt,
ClassDescriptor cld,
Object obj)
throws SQLException
bindDelete in interface StatementManagerIFSQLException
public int bindStatement(PreparedStatement stmt,
Query query,
ClassDescriptor cld,
int param)
throws SQLException
bindStatement in interface StatementManagerIFSQLException
protected int bindStatement(PreparedStatement stmt,
Criteria crit,
ClassDescriptor cld,
int param)
throws SQLException
SQLException
public void bindInsert(PreparedStatement stmt,
ClassDescriptor cld,
Object obj)
throws SQLException
bindInsert in interface StatementManagerIFSQLException
public void bindSelect(PreparedStatement stmt,
Identity oid,
ClassDescriptor cld,
boolean callableStmt)
throws SQLException
bindSelect in interface StatementManagerIFcld - ClassDescriptor for the Object, if null will be lookup automaticcallableStmt - Indicate if the specified PreparedStatement
is a CallableStatement supporting stored procedures.
SQLException
public void bindUpdate(PreparedStatement stmt,
ClassDescriptor cld,
Object obj)
throws SQLException
bindUpdate in interface StatementManagerIFSQLException
public int bindValues(PreparedStatement stmt,
ValueContainer[] values,
int index)
throws SQLException
bindValues in interface StatementManagerIFSQLException
public PreparedStatement getDeleteStatement(ClassDescriptor cld)
throws PersistenceBrokerSQLException,
PersistenceBrokerException
getDeleteStatement in interface StatementManagerIFPersistenceBrokerSQLException
PersistenceBrokerException
public Statement getGenericStatement(ClassDescriptor cds,
boolean scrollable)
throws PersistenceBrokerException
getGenericStatement in interface StatementManagerIFPersistenceBrokerException
public PreparedStatement getInsertStatement(ClassDescriptor cds)
throws PersistenceBrokerSQLException,
PersistenceBrokerException
getInsertStatement in interface StatementManagerIFPersistenceBrokerSQLException
PersistenceBrokerException
public PreparedStatement getPreparedStatement(ClassDescriptor cds,
String sql,
boolean scrollable,
int explicitFetchSizeHint,
boolean callableStmt)
throws PersistenceBrokerException
getPreparedStatement in interface StatementManagerIFPersistenceBrokerException
public PreparedStatement getSelectByPKStatement(ClassDescriptor cds)
throws PersistenceBrokerSQLException,
PersistenceBrokerException
getSelectByPKStatement in interface StatementManagerIFPersistenceBrokerSQLException
PersistenceBrokerException
public PreparedStatement getUpdateStatement(ClassDescriptor cds)
throws PersistenceBrokerSQLException,
PersistenceBrokerException
getUpdateStatement in interface StatementManagerIFPersistenceBrokerSQLException
PersistenceBrokerException
protected ValueContainer[] getAllValues(ClassDescriptor cld,
Object obj)
throws PersistenceBrokerException
PersistenceBrokerException - if there is an erros accessing obj field values
protected ValueContainer[] getKeyValues(PersistenceBroker broker,
ClassDescriptor cld,
Object obj)
throws PersistenceBrokerException
PersistenceBrokerException - if there is an erros accessing o field values
protected ValueContainer[] getKeyValues(PersistenceBroker broker,
ClassDescriptor cld,
Identity oid)
throws PersistenceBrokerException
PersistenceBrokerException - if there is an erros accessing o field values
protected ValueContainer[] getNonKeyValues(PersistenceBroker broker,
ClassDescriptor cld,
Object obj)
throws PersistenceBrokerException
PersistenceBrokerException - if there is an erros accessing o field values
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||