|
|||||||||
| Home >> All >> org >> objectstyle >> cayenne >> [ access overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.objectstyle.cayenne.access
Class DefaultOperationObserver

java.lang.Objectorg.objectstyle.cayenne.access.DefaultOperationObserver
- All Implemented Interfaces:
- OperationHints, OperationObserver
- public class DefaultOperationObserver
- extends java.lang.Object
- implements OperationObserver
- extends java.lang.Object
Simple implementation of OperationObserver interface. Useful as a superclass of other implementations of OperationObserver.
For more information see Cayenne User Guide.
| Field Summary | |
static org.apache.log4j.Level |
DEFAULT_LOG_LEVEL
|
protected java.util.List |
globalExceptions
|
protected org.apache.log4j.Level |
loggingLevel
|
private static org.apache.log4j.Logger |
logObj
|
protected java.util.Map |
queryExceptions
|
protected boolean |
transactionCommitted
|
protected boolean |
transactionRolledback
|
| Constructor Summary | |
DefaultOperationObserver()
|
|
| Method Summary | |
java.util.List |
getGlobalExceptions()
Returns a list of global exceptions that occured during data operation run. |
org.apache.log4j.Level |
getLoggingLevel()
Returns a log level level that should be used when logging query execution. |
java.util.Map |
getQueryExceptions()
Returns a list of exceptions that occured during data operation run by query. |
boolean |
hasExceptions()
Returns true if at least one exception was registered
during query execution. |
boolean |
isIteratedResult()
Returns false. |
boolean |
isTransactionCommitted()
|
boolean |
isTransactionRolledback()
|
void |
nextCount(org.objectstyle.cayenne.query.Query query,
int resultCount)
Invoked after the update (can be insert, delete or update query) is executed. |
void |
nextDataRows(org.objectstyle.cayenne.query.Query query,
java.util.List dataRows)
Invoked after the next query results are read. |
void |
nextDataRows(org.objectstyle.cayenne.query.Query q,
ResultIterator it)
Invoked after the next query is invoked, if a query required results to be returned as a ResultIterator. |
void |
nextGlobalException(java.lang.Exception ex)
Invoked when a "global" exception occurred, such as JDBC connection exception, etc. |
void |
nextQueryException(org.objectstyle.cayenne.query.Query query,
java.lang.Exception ex)
Invoked when an exception occurs during query execution. |
java.util.List |
orderQueries(DataNode aNode,
java.util.List queryList)
Returns query list without altering its ordering. |
void |
printExceptions(java.io.PrintWriter out)
Prints the information about query and global exceptions. |
void |
setLoggingLevel(org.apache.log4j.Level level)
Sets log level that should be used for queries. |
void |
transactionCommitted()
Invoked when a batch of queries was processed as a single transaction, and this transaction was successfully committed. |
void |
transactionRolledback()
Invoked when a batch of queries was processed as a single transaction, and this transaction was failed and was rolled back. |
boolean |
useAutoCommit()
Returns true so that individual queries are executed in separate
transactions. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.objectstyle.cayenne.access.OperationObserver |
nextBatchCount |
| Field Detail |
logObj
private static org.apache.log4j.Logger logObj
DEFAULT_LOG_LEVEL
public static final org.apache.log4j.Level DEFAULT_LOG_LEVEL
globalExceptions
protected java.util.List globalExceptions
queryExceptions
protected java.util.Map queryExceptions
transactionCommitted
protected boolean transactionCommitted
transactionRolledback
protected boolean transactionRolledback
loggingLevel
protected org.apache.log4j.Level loggingLevel
| Constructor Detail |
DefaultOperationObserver
public DefaultOperationObserver()
| Method Detail |
printExceptions
public void printExceptions(java.io.PrintWriter out)
- Prints the information about query and global exceptions.
getGlobalExceptions
public java.util.List getGlobalExceptions()
- Returns a list of global exceptions that occured during data operation run.
getQueryExceptions
public java.util.Map getQueryExceptions()
- Returns a list of exceptions that occured during data operation run by query.
hasExceptions
public boolean hasExceptions()
- Returns
trueif at least one exception was registered during query execution.
isTransactionCommitted
public boolean isTransactionCommitted()
isTransactionRolledback
public boolean isTransactionRolledback()
getLoggingLevel
public org.apache.log4j.Level getLoggingLevel()
- Returns a log level level that should be used when
logging query execution.
- Specified by:
getLoggingLevelin interfaceOperationHints
setLoggingLevel
public void setLoggingLevel(org.apache.log4j.Level level)
- Sets log level that should be used for queries.
If
levelargument is null, level is set to DEFAULT_LOG_LEVEL. Iflevelis equal or higher than log level configured for QueryLogger, query SQL statements will be logged.
nextCount
public void nextCount(org.objectstyle.cayenne.query.Query query, int resultCount)
- Description copied from interface:
OperationObserver - Invoked after the update (can be insert, delete or update query) is executed.
- Specified by:
nextCountin interfaceOperationObserver
nextDataRows
public void nextDataRows(org.objectstyle.cayenne.query.Query query, java.util.List dataRows)
- Description copied from interface:
OperationObserver - Invoked after the next query results are read.
- Specified by:
nextDataRowsin interfaceOperationObserver
nextDataRows
public void nextDataRows(org.objectstyle.cayenne.query.Query q, ResultIterator it)
- Description copied from interface:
OperationObserver - Invoked after the next query is invoked, if a query required
results to be returned as a ResultIterator. OperationObserver
is responsible for closing the ResultIterator.
- Specified by:
nextDataRowsin interfaceOperationObserver
nextQueryException
public void nextQueryException(org.objectstyle.cayenne.query.Query query, java.lang.Exception ex)
- Description copied from interface:
OperationObserver - Invoked when an exception occurs during query execution.
- Specified by:
nextQueryExceptionin interfaceOperationObserver
nextGlobalException
public void nextGlobalException(java.lang.Exception ex)
- Description copied from interface:
OperationObserver - Invoked when a "global" exception occurred, such as JDBC
connection exception, etc.
- Specified by:
nextGlobalExceptionin interfaceOperationObserver
transactionCommitted
public void transactionCommitted()
- Description copied from interface:
OperationObserver - Invoked when a batch of queries was processed as a single transaction,
and this transaction was successfully committed.
- Specified by:
transactionCommittedin interfaceOperationObserver
transactionRolledback
public void transactionRolledback()
- Description copied from interface:
OperationObserver - Invoked when a batch of queries was processed as a single transaction,
and this transaction was failed and was rolled back.
- Specified by:
transactionRolledbackin interfaceOperationObserver
useAutoCommit
public boolean useAutoCommit()
- Returns
trueso that individual queries are executed in separate transactions.- Specified by:
useAutoCommitin interfaceOperationHints
orderQueries
public java.util.List orderQueries(DataNode aNode, java.util.List queryList)
- Returns query list without altering its ordering.
isIteratedResult
public boolean isIteratedResult()
- Returns
false.- Specified by:
isIteratedResultin interfaceOperationHints
|
|||||||||
| Home >> All >> org >> objectstyle >> cayenne >> [ access overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.objectstyle.cayenne.access.DefaultOperationObserver