org.jpox.store.query
Interface Queryable

All Known Subinterfaces:
QueryResult
All Known Implementing Classes:
AbstractQueryResult, ArrayList, ClassTableExtent, ClassViewExtent, Collection, CollectionCandidates, ForwardQueryResult, HashMap, HashSet, Hashtable, InsensitiveQueryResult, LinkedHashMap, LinkedHashSet, LinkedList, List, Map, Properties, ResultExpressionsQueryable, Set, SortedMap, SortedSet, Stack, TreeMap, TreeSet, Vector

public interface Queryable

Indicates an object that can be queried, such as an Extent or persistent collection.

Version:
$Revision: 1.5 $
See Also:
QueryStatement

Method Summary
 boolean isEmpty()
          Returns true if this collection contains no elements.
 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.
 

Method Detail

newQueryStatement

public QueryExpression newQueryStatement()
Returns a prototypical query statement over the underlying collection.

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.

Returns:
The new prototypical query statement.

newQueryStatement

public 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.

Parameters:
candidateClass -
Returns:
The new prototypical query statement.
Throws:
javax.jdo.JDOUserException - If candidateClass is not the same as or a subclass of the defined element type for this collection.
See Also:
newQueryStatement()

newResultObjectFactory

public 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.

The stmt argument must have been obtained by a previous call to newQueryStatement() on the same Queryable.

Parameters:
stmt - The query statement
ignoreCache - Whether to ignore the cache
resultClass - Create objects of a particular type
useFetchPlan - whether to use the fetch plan to retrieve fields in the same query
Returns:
A factory for creating PersistenceCapable objects from query results.

isEmpty

public boolean isEmpty()
Returns true if this collection contains no elements.

Returns:
true if this collection contains no elements.


Copyright © -2007 . All Rights Reserved.