|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractList
org.jpox.store.query.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 StatementMethod 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.List
index
- The position to addelement
- The results to addpublic boolean add(java.lang.Object o)
add
in interface java.util.Collection
o
- The result to add
public boolean addAll(int index, java.util.Collection c)
addAll
in interface java.util.List
index
- The position to addc
- The results to add
public void clear()
clear
in interface java.util.Collection
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection
o
- The object
public boolean containsAll(java.util.Collection c)
containsAll
in interface java.util.Collection
c
- The collection of objects
public abstract boolean equals(java.lang.Object o)
equals
in interface java.util.Collection
o
- The object to compare against
public abstract java.lang.Object get(int index)
get
in interface java.util.List
index
- The index of the element
public int hashCode()
hashCode
in interface java.util.Collection
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List
o
- The result
public abstract boolean isEmpty()
This implementation check if the result is empty.
isEmpty
in interface Queryable
public abstract java.util.Iterator iterator()
iterator
in interface java.util.Collection
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List
o
- The result
public abstract java.util.ListIterator listIterator()
listIterator
in interface java.util.List
public java.lang.Object remove(int index)
remove
in interface java.util.List
index
- The position of the result.
public java.lang.Object set(int index, java.lang.Object element)
set
in interface java.util.List
index
- Position of the resultelement
- The result
public abstract int size()
size
in interface java.util.Collection
public java.util.List subList(int fromIndex, int toIndex)
subList
in interface java.util.List
fromIndex
- start positiontoIndex
- end position (exclusive)
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
public java.lang.Object[] toArray(java.lang.Object[] a)
toArray
in interface java.util.Collection
a
- The array to copy into.
public QueryExpression newQueryStatement()
Queryable
The 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 Queryable
public QueryExpression newQueryStatement(java.lang.Class candidateClass)
Queryable
newQueryStatement
in interface Queryable
candidateClass
-
Queryable.newQueryStatement()
public Query.ResultObjectFactory newResultObjectFactory(QueryExpression stmt, boolean ignoreCache, java.lang.Class resultClass, boolean useFetchPlan)
Queryable
The stmt argument must have been obtained by a previous call to newQueryStatement() on the same Queryable.
newResultObjectFactory
in interface Queryable
stmt
- 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 |