|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList
org.datanucleus.store.query.AbstractQueryResult
org.datanucleus.store.rdbms.query.AbstractRDBMSQueryResult
org.datanucleus.store.rdbms.query.ForwardQueryResult
public final class ForwardQueryResult
Lazy collection results from a Query with the ResultSet in a forward direction. In general the actual result elements are only loaded when accessed with the exception of non-transactional or optimistic contexts that load the elements at initialisation.
If the query had a range defined and this was not handled in the datastore query then this QueryResult will skip the unrequired records and just return the range requested.
| Field Summary | |
|---|---|
protected boolean |
moreResultSetRows
Whether there are still more rows to be processed in the ResultSet. |
protected List |
resultIds
|
protected List |
resultObjs
The Result Objects. |
| Fields inherited from class org.datanucleus.store.rdbms.query.AbstractRDBMSQueryResult |
|---|
rof, rs |
| Fields inherited from class org.datanucleus.store.query.AbstractQueryResult |
|---|
closed, connectionListeners, loadResultsAtCommit, LOCALISER, query, resultSizeMethod, size |
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
ForwardQueryResult(org.datanucleus.store.query.Query query,
org.datanucleus.store.query.ResultObjectFactory rof,
ResultSet rs,
Collection candidates)
Constructor of the result from a Query. |
|
| Method Summary | |
|---|---|
void |
close()
Method to close the results, making the results unusable thereafter. |
protected void |
closeResults()
Internal method to close the ResultSet. |
protected void |
closingConnection()
Method called to inform the query result that the connection is being closed so perform any required operations now, or rest in peace. |
boolean |
contains(Object o)
Method to check if the specified object is contained in this result. |
boolean |
containsAll(Collection c)
Method to check if all of the specified objects are contained here. |
boolean |
equals(Object o)
Equality operator for QueryResults. |
Object |
get(int index)
Method to retrieve a particular element from the list. |
protected int |
getSizeUsingMethod()
Method to get the size using the "resultSizeMethod". |
boolean |
isEmpty()
Accessor for whether there are any results. |
Iterator |
iterator()
Accessor for an iterator for the results. |
ListIterator |
listIterator()
Accessor for an iterator for the results. |
protected Object |
nextResultSetElement()
Accessor for the next object from the ResultSet. |
Object[] |
toArray()
Method to return the results as an array. |
Object[] |
toArray(Object[] a)
Method to return the results as an array. |
protected Object |
writeReplace()
Handle serialisation by returning a java.util.ArrayList of all of the results for this query after disconnecting the query which has the consequence of enforcing the load of all objects. |
| Methods inherited from class org.datanucleus.store.rdbms.query.AbstractRDBMSQueryResult |
|---|
disconnect, hashCode |
| Methods inherited from class org.datanucleus.store.query.AbstractQueryResult |
|---|
add, add, addAll, addConnectionListener, assertIsOpen, clear, indexOf, isOpen, lastIndexOf, remove, set, size, subList |
| Methods inherited from class java.util.AbstractList |
|---|
listIterator, removeRange |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, remove, removeAll, retainAll, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Collection |
|---|
addAll, remove, removeAll, retainAll |
| Methods inherited from interface java.util.List |
|---|
addAll, remove, removeAll, retainAll |
| Field Detail |
|---|
protected boolean moreResultSetRows
protected List resultObjs
protected List resultIds
| Constructor Detail |
|---|
public ForwardQueryResult(org.datanucleus.store.query.Query query,
org.datanucleus.store.query.ResultObjectFactory rof,
ResultSet rs,
Collection candidates)
throws SQLException
query - The Queryrof - The factory to retrieve results fromrs - The ResultSet from the Query Statementcandidates - Candidate elements
SQLException - if can't read ResultSet| Method Detail |
|---|
protected Object nextResultSetElement()
protected void closeResults()
closeResults in class AbstractRDBMSQueryResultpublic void close()
close in interface org.datanucleus.store.query.QueryResultclose in class AbstractRDBMSQueryResultprotected void closingConnection()
closingConnection in class org.datanucleus.store.query.AbstractQueryResultpublic Iterator iterator()
iterator in interface Iterableiterator in interface Collectioniterator in interface Listiterator in class org.datanucleus.store.query.AbstractQueryResultpublic ListIterator listIterator()
listIterator in interface ListlistIterator in class org.datanucleus.store.query.AbstractQueryResultpublic boolean contains(Object o)
contains in interface Collectioncontains in interface Listcontains in class org.datanucleus.store.query.AbstractQueryResulto - The object
public boolean containsAll(Collection c)
containsAll in interface CollectioncontainsAll in interface ListcontainsAll in class org.datanucleus.store.query.AbstractQueryResultc - The collection of objects
public boolean equals(Object o)
equals in interface Collectionequals in interface Listequals in class org.datanucleus.store.query.AbstractQueryResulto - The object to compare against
public Object get(int index)
get in interface Listget in class org.datanucleus.store.query.AbstractQueryResultindex - The index of the element
public boolean isEmpty()
isEmpty in interface CollectionisEmpty in interface ListisEmpty in class org.datanucleus.store.query.AbstractQueryResultprotected int getSizeUsingMethod()
getSizeUsingMethod in class org.datanucleus.store.query.AbstractQueryResultpublic Object[] toArray()
toArray in interface CollectiontoArray in interface ListtoArray in class org.datanucleus.store.query.AbstractQueryResultpublic Object[] toArray(Object[] a)
toArray in interface CollectiontoArray in interface ListtoArray in class org.datanucleus.store.query.AbstractQueryResulta - The array to copy into.
protected Object writeReplace()
throws ObjectStreamException
ObjectStreamException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||