Package org.apache.cayenne.util
Class GenericQueryResult<T>
java.lang.Object
org.apache.cayenne.util.GenericQueryResult<T>
- All Implemented Interfaces:
- Iterable<QueryResultItem>,- QueryResult<T>
- Direct Known Subclasses:
- ProcedureResult
public class GenericQueryResult<T> extends Object implements QueryResult<T>
Generic implementation of QueryResult using List as QueryResultItem storage.
- Since:
- 4.0
- 
Field SummaryFields Modifier and Type Field Description protected Class<T>resultClassprotected List<QueryResultItem>resultItems
- 
Constructor SummaryConstructors Constructor Description GenericQueryResult(List<QueryResultItem> resultItems)GenericQueryResult(List<QueryResultItem> resultItems, Class<T> resultClass)
- 
Method SummaryModifier and Type Method Description int[]firstBatchUpdateCount()A utility method for quickly retrieving the first batch update count array from the response.List<T>firstList()A utility method for quickly retrieving the first list in the response.intfirstUpdateCount()A utility method for quick retrieval of the first update count from the response.booleanisList()Returns whether current iteration result is a list or an update count.Iterator<QueryResultItem>iterator()intsize()Returns a number of results in the response.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Field Details- 
resultClass
- 
resultItems
 
- 
- 
Constructor Details- 
GenericQueryResult
- 
GenericQueryResult
 
- 
- 
Method Details- 
sizepublic int size()Description copied from interface:QueryResultReturns a number of results in the response.- Specified by:
- sizein interface- QueryResult<T>
 
- 
isListpublic boolean isList()Description copied from interface:QueryResultReturns whether current iteration result is a list or an update count.- Specified by:
- isListin interface- QueryResult<T>
 
- 
firstListDescription copied from interface:QueryResultA utility method for quickly retrieving the first list in the response. Returns null if the query has no lists.- Specified by:
- firstListin interface- QueryResult<T>
 
- 
firstBatchUpdateCountpublic int[] firstBatchUpdateCount()Description copied from interface:QueryResultA utility method for quickly retrieving the first batch update count array from the response.- Specified by:
- firstBatchUpdateCountin interface- QueryResult<T>
 
- 
firstUpdateCountpublic int firstUpdateCount()Description copied from interface:QueryResultA utility method for quick retrieval of the first update count from the response.- Specified by:
- firstUpdateCountin interface- QueryResult<T>
 
- 
iterator
 
-