org.jpox.store.mapped.query
Class CollectionCandidates

java.lang.Object
  extended by org.jpox.store.mapped.query.CollectionCandidates
All Implemented Interfaces:
Queryable

public class CollectionCandidates
extends java.lang.Object
implements Queryable

Collection for candidates passed to the query by setCandidates(collection).

Version:
$Revision: 1.14 $

Field Summary
protected static Localiser LOCALISER
           
 
Constructor Summary
CollectionCandidates(ObjectManager om, java.lang.Class candidateClass, java.util.Collection candidates)
          Constructor.
 
Method Summary
 FetchPlan getFetchPlan()
          Accessor for the fetch plan
 java.util.Collection getUserCandidates()
           
 boolean isEmpty()
          Returns true if this collection contains no elements.
 QueryExpression newQueryStatement()
          Accessor for a new Query statement.
 QueryExpression newQueryStatement(java.lang.Class candidateClass, DatastoreIdentifier candidateAlias)
          Creates a QueryStatement.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALISER

protected static final Localiser LOCALISER
Constructor Detail

CollectionCandidates

public CollectionCandidates(ObjectManager om,
                            java.lang.Class candidateClass,
                            java.util.Collection candidates)
Constructor.

Parameters:
om - Object Manager
candidateClass - the Class candidate
candidates - The candidates
Method Detail

getUserCandidates

public java.util.Collection getUserCandidates()
Returns:
Returns the userCandidates.

getFetchPlan

public FetchPlan getFetchPlan()
Accessor for the fetch plan

Returns:
The fetch plan

newQueryStatement

public QueryExpression newQueryStatement()
Accessor for a new Query statement.

Specified by:
newQueryStatement in interface Queryable
Returns:
The Query Statement

newQueryStatement

public QueryExpression newQueryStatement(java.lang.Class candidateClass,
                                         DatastoreIdentifier candidateAlias)
Creates a QueryStatement. The elements that are ALLOWED to be returned after quering the database are the set of elements contained in the candidate collection.

Specified by:
newQueryStatement in interface Queryable
Parameters:
candidateClass - Candidate class
candidateAlias - Alias to use for the candidate in the query (if the native query supports it)
Returns:
Query Statement

newResultObjectFactory

public ResultObjectFactory newResultObjectFactory(QueryExpression stmt,
                                                  boolean ignoreCache,
                                                  java.lang.Class resultClass,
                                                  boolean useFetchPlan)
Description copied from interface: Queryable
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.

Specified by:
newResultObjectFactory in interface 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.

Specified by:
isEmpty in interface Queryable
Returns:
true if this collection contains no elements.


Copyright © -2008 . All Rights Reserved.