org.apache.cayenne.access.util
Class SelectObserver

java.lang.Object
  extended by org.apache.cayenne.access.util.DefaultOperationObserver
      extended by org.apache.cayenne.access.util.SelectObserver
All Implemented Interfaces:
OperationHints, OperationObserver

Deprecated. since 1.2 SelectObserver is no longer used in Cayenne internally. Users should switch to QueryResult.

public class SelectObserver
extends DefaultOperationObserver

OperationObserver that accumulates select query results provided by callback methods. Later the results can be retrieved via different getResults methods. Also supports instantiating DataObjects within a provided DataContext.

This class is used as a default OperationObserver by DataContext. Also it can serve as a helper for classes that work with DataNode directly, bypassing DataContext.

If exceptions happen during the execution, they are immediately rethrown.

For more information see Cayenne User Guide.

Author:
Andrei Adamchik
See Also:
QueryResult

Field Summary
protected  java.util.Map results
          Deprecated.  
protected  int selectCount
          Deprecated.  
 
Fields inherited from class org.apache.cayenne.access.util.DefaultOperationObserver
DEFAULT_LOG_LEVEL, globalExceptions, queryExceptions
 
Constructor Summary
SelectObserver()
          Deprecated.  
SelectObserver(org.apache.log4j.Level logLevel)
          Deprecated. since 1.2
 
Method Summary
 void clear()
          Deprecated. Clears fetched objects stored in an internal list.
 java.util.Map getResults()
          Deprecated. Returns query results accumulated during query execution with this object as an operation observer.
 java.util.List getResults(Query q)
          Deprecated. Returns a list of result snapshots for the specified query, or null if this query has never produced any results.
 java.util.List getResultsAsObjects(DataContext dataContext, Query rootQuery)
          Deprecated. since 1.2. Note that this implementation no longer resolves prefetches properly.
 int getSelectCount()
          Deprecated. Returns a count of select queries that returned results since the last time "clear" was called, or since this object was created.
 void nextDataRows(Query query, java.util.List dataRows)
          Deprecated. Stores all objects in dataRows in an internal result list.
 void nextGlobalException(java.lang.Exception ex)
          Deprecated. Overrides superclass implementation to rethrow an exception immediately.
 void nextQueryException(Query query, java.lang.Exception ex)
          Deprecated. Overrides super implementation to rethrow an exception immediately.
 
Methods inherited from class org.apache.cayenne.access.util.DefaultOperationObserver
getGlobalExceptions, getLoggingLevel, getQueryExceptions, hasExceptions, isIteratedResult, nextBatchCount, nextCount, nextDataRows, nextGeneratedDataRows, printExceptions, setLoggingLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

results

protected java.util.Map results
Deprecated. 

selectCount

protected int selectCount
Deprecated. 
Constructor Detail

SelectObserver

public SelectObserver()
Deprecated. 

SelectObserver

public SelectObserver(org.apache.log4j.Level logLevel)
Deprecated. since 1.2

Method Detail

getSelectCount

public int getSelectCount()
Deprecated. 
Returns a count of select queries that returned results since the last time "clear" was called, or since this object was created.


getResults

public java.util.List getResults(Query q)
Deprecated. 
Returns a list of result snapshots for the specified query, or null if this query has never produced any results.


getResults

public java.util.Map getResults()
Deprecated. 
Returns query results accumulated during query execution with this object as an operation observer.


clear

public void clear()
Deprecated. 
Clears fetched objects stored in an internal list.


nextDataRows

public void nextDataRows(Query query,
                         java.util.List dataRows)
Deprecated. 
Stores all objects in dataRows in an internal result list.

Specified by:
nextDataRows in interface OperationObserver
Overrides:
nextDataRows in class DefaultOperationObserver

getResultsAsObjects

public java.util.List getResultsAsObjects(DataContext dataContext,
                                          Query rootQuery)
Deprecated. since 1.2. Note that this implementation no longer resolves prefetches properly.

Since:
1.1

nextQueryException

public void nextQueryException(Query query,
                               java.lang.Exception ex)
Deprecated. 
Overrides super implementation to rethrow an exception immediately.

Specified by:
nextQueryException in interface OperationObserver
Overrides:
nextQueryException in class DefaultOperationObserver

nextGlobalException

public void nextGlobalException(java.lang.Exception ex)
Deprecated. 
Overrides superclass implementation to rethrow an exception immediately.

Specified by:
nextGlobalException in interface OperationObserver
Overrides:
nextGlobalException in class DefaultOperationObserver


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