|
||||||||||
| 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.jpox.store.query.AbstractQueryResult
public abstract class AbstractQueryResult
Abstract representation of a QueryResult.
| Field Summary | |
|---|---|
protected boolean |
closed
Whether the results are close. |
protected static Localiser |
LOCALISER
Localiser for messages. |
protected QueryExpression |
qs
The Query statement used to generate these results. |
protected Query |
query
The Query object. |
protected Query.ResultObjectFactory |
rof
Result Object Factory used for accessing the elements. |
protected java.sql.ResultSet |
rs
The ResultSet containing the results. |
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
AbstractQueryResult(QueryExpression qs,
Query query,
Query.ResultObjectFactory rof,
java.sql.ResultSet rs)
Constructor of the result from a Query. |
|
| Method Summary | |
|---|---|
void |
add(int index,
java.lang.Object element)
Method to add a result. |
boolean |
add(java.lang.Object o)
Method to add results. |
boolean |
addAll(int index,
java.util.Collection c)
Method to add results. |
protected void |
assertIsOpen()
Internal method to throw a JDOUserException if the ResultSet is open. |
void |
clear()
Method to clear the results. |
void |
close()
Method to close the results. |
protected void |
closeResultSet()
Internal method to close the ResultSet. |
boolean |
contains(java.lang.Object o)
Method to check if the specified object is contained in this result. |
boolean |
containsAll(java.util.Collection c)
Method to check if all of the specified objects are contained here. |
abstract boolean |
equals(java.lang.Object o)
Equality operator for QueryResults. |
abstract java.lang.Object |
get(int index)
Method to retrieve a particular element from the list. |
int |
hashCode()
Accessor for the hashcode of this object |
int |
indexOf(java.lang.Object o)
Method to check the index of a result. |
abstract boolean |
isEmpty()
Returns true if this collection contains no elements. |
protected boolean |
isOpen()
Accessor whether the results are open. |
abstract java.util.Iterator |
iterator()
Accessor for an iterator for the results. |
int |
lastIndexOf(java.lang.Object o)
Method to check the last index of a result. |
abstract java.util.ListIterator |
listIterator()
Accessor for a list iterator for the results. |
QueryExpression |
newQueryStatement()
Returns a prototypical query statement over the underlying collection. |
QueryExpression |
newQueryStatement(java.lang.Class candidateClass)
Returns a prototypical query statement over the underlying collection, pre-filtered to include only objects of the specified class. |
Query.ResultObjectFactory |
newResultObjectFactory(QueryExpression stmt,
boolean ignoreCache,
java.lang.Class resultClass,
boolean useFetchPlan)
Returns a suitable query result factory for results produced by the specified query. |
java.lang.Object |
remove(int index)
Method to remove a result. |
java.lang.Object |
set(int index,
java.lang.Object element)
Method to set the position of a result. |
abstract int |
size()
Method to return the size of the result. |
java.util.List |
subList(int fromIndex,
int toIndex)
Method return a sub list of results. |
java.lang.Object[] |
toArray()
Method to return the results as an array. |
java.lang.Object[] |
toArray(java.lang.Object[] a)
Method to return the results as an array. |
| 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 org.jpox.store.query.QueryResult |
|---|
closingConnection |
| 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 static final Localiser LOCALISER
protected final Query query
protected final Query.ResultObjectFactory rof
protected java.sql.ResultSet rs
protected QueryExpression qs
protected boolean closed
| Constructor Detail |
|---|
public AbstractQueryResult(QueryExpression qs,
Query query,
Query.ResultObjectFactory rof,
java.sql.ResultSet rs)
qs - The Query Statementquery - The Queryrof - The factory to retrieve results fromrs - The ResultSet from the Query Statement| Method Detail |
|---|
protected boolean isOpen()
protected void assertIsOpen()
protected void closeResultSet()
public void close()
close in interface QueryResult
public void add(int index,
java.lang.Object element)
add in interface java.util.Listadd in class java.util.AbstractListindex - The position to addelement - The results to addpublic boolean add(java.lang.Object o)
add in interface java.util.Collectionadd in interface java.util.Listadd in class java.util.AbstractListo - The result to add
public boolean addAll(int index,
java.util.Collection c)
addAll in interface java.util.ListaddAll in class java.util.AbstractListindex - The position to addc - The results to add
public void clear()
clear in interface java.util.Collectionclear in interface java.util.Listclear in class java.util.AbstractListpublic boolean contains(java.lang.Object o)
contains in interface java.util.Collectioncontains in interface java.util.Listcontains in class java.util.AbstractCollectiono - The object
public boolean containsAll(java.util.Collection c)
containsAll in interface java.util.CollectioncontainsAll in interface java.util.ListcontainsAll in class java.util.AbstractCollectionc - The collection of objects
public abstract boolean equals(java.lang.Object o)
equals in interface java.util.Collectionequals in interface java.util.Listequals in class java.util.AbstractListo - The object to compare against
public abstract java.lang.Object get(int index)
get in interface java.util.Listget in class java.util.AbstractListindex - The index of the element
public int hashCode()
hashCode in interface java.util.CollectionhashCode in interface java.util.ListhashCode in class java.util.AbstractListpublic int indexOf(java.lang.Object o)
indexOf in interface java.util.ListindexOf in class java.util.AbstractListo - The result
public abstract boolean isEmpty()
This implementation check if the result is empty.
isEmpty in interface java.util.CollectionisEmpty in interface java.util.ListisEmpty in interface QueryableisEmpty in class java.util.AbstractCollectionpublic abstract java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Listiterator in class java.util.AbstractListpublic int lastIndexOf(java.lang.Object o)
lastIndexOf in interface java.util.ListlastIndexOf in class java.util.AbstractListo - The result
public abstract java.util.ListIterator listIterator()
listIterator in interface java.util.ListlistIterator in class java.util.AbstractListpublic java.lang.Object remove(int index)
remove in interface java.util.Listremove in class java.util.AbstractListindex - The position of the result.
public java.lang.Object set(int index,
java.lang.Object element)
set in interface java.util.Listset in class java.util.AbstractListindex - Position of the resultelement - The result
public abstract int size()
size in interface java.util.Collectionsize in interface java.util.Listsize in class java.util.AbstractCollection
public java.util.List subList(int fromIndex,
int toIndex)
subList in interface java.util.ListsubList in class java.util.AbstractListfromIndex - start positiontoIndex - end position (exclusive)
public java.lang.Object[] toArray()
toArray in interface java.util.CollectiontoArray in interface java.util.ListtoArray in class java.util.AbstractCollectionpublic java.lang.Object[] toArray(java.lang.Object[] a)
toArray in interface java.util.CollectiontoArray in interface java.util.ListtoArray in class java.util.AbstractCollectiona - The array to copy into.
public QueryExpression newQueryStatement()
QueryableThe returned query statement selects all applicable rows from the relevant base table(s) and the column that represents the element or element ID. The statement can then be modified to join additional tables, select more columns, add WHERE conditions, etc.
newQueryStatement in interface Queryablepublic QueryExpression newQueryStatement(java.lang.Class candidateClass)
Queryable
newQueryStatement in interface QueryableQueryable.newQueryStatement()
public Query.ResultObjectFactory newResultObjectFactory(QueryExpression stmt,
boolean ignoreCache,
java.lang.Class resultClass,
boolean useFetchPlan)
QueryableThe stmt argument must have been obtained by a previous call to newQueryStatement() on the same Queryable.
newResultObjectFactory in interface Queryablestmt - The query statementignoreCache - Whether to ignore the cacheresultClass - Create objects of a particular typeuseFetchPlan - whether to use the fetch plan to retrieve fields in the same query
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||