org.datanucleus.store.rdbms.query
Class ResultExpressionsQueryable

java.lang.Object
  extended by org.datanucleus.store.rdbms.query.ResultExpressionsQueryable
All Implemented Interfaces:
org.datanucleus.store.mapped.expression.Queryable

public class ResultExpressionsQueryable
extends java.lang.Object
implements org.datanucleus.store.mapped.expression.Queryable

Result expressions to be returned by the query. The results might be fields of persistent instances, instances of classes other than the candidate class, or aggregates of fields.


Field Summary
protected static org.datanucleus.util.Localiser LOCALISER
           
 
Constructor Summary
ResultExpressionsQueryable(org.datanucleus.ObjectManager om, java.lang.Class candidateClass, boolean subclasses)
          Constructor.
ResultExpressionsQueryable(org.datanucleus.ObjectManager om, java.lang.Class candidateClass, java.util.Collection userCandidates, boolean subclasses)
          Constructor.
 
Method Summary
 org.datanucleus.store.mapped.expression.ScalarExpression[] getResultExpressions()
           
 boolean hasAggregatedExpressionsOnly()
          Whether only aggregated expressions are returned
 boolean isEmpty()
          Returns true if this collection contains no elements.
 org.datanucleus.store.mapped.expression.QueryExpression newQueryStatement()
          Create a new query to search for the candidate classes etc.
 org.datanucleus.store.mapped.expression.QueryExpression newQueryStatement(java.lang.Class candidateClass, org.datanucleus.store.mapped.DatastoreIdentifier candidateAlias)
          Create a query to search for the candidateClass and subclasses if true
 org.datanucleus.store.query.ResultObjectFactory newResultObjectFactory(org.datanucleus.store.mapped.expression.QueryExpression stmt, boolean ignoreCache, java.lang.Class resultClass, boolean useFetchPlan)
           
 void setHasAggregatedExpressionsOnly(boolean flag)
          Convenience method to set if we know there are only aggregate expressions and so can ignore any checks on the result expressions.
 void setResultExpressions(org.datanucleus.store.mapped.expression.ScalarExpression[] expressions)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALISER

protected static final org.datanucleus.util.Localiser LOCALISER
Constructor Detail

ResultExpressionsQueryable

public ResultExpressionsQueryable(org.datanucleus.ObjectManager om,
                                  java.lang.Class candidateClass,
                                  boolean subclasses)
Constructor.

Parameters:
om - Object Manager
candidateClass - The candidate
subclasses - Whether to include subclasses

ResultExpressionsQueryable

public ResultExpressionsQueryable(org.datanucleus.ObjectManager om,
                                  java.lang.Class candidateClass,
                                  java.util.Collection userCandidates,
                                  boolean subclasses)
Constructor.

Parameters:
om - Object Manager
candidateClass - The candidate
userCandidates - The users candidates
subclasses - Whether to include subclasses
Method Detail

newQueryStatement

public org.datanucleus.store.mapped.expression.QueryExpression newQueryStatement()
Create a new query to search for the candidate classes etc.

Specified by:
newQueryStatement in interface org.datanucleus.store.mapped.expression.Queryable
Returns:
The new QueryStatement.

newQueryStatement

public org.datanucleus.store.mapped.expression.QueryExpression newQueryStatement(java.lang.Class candidateClass,
                                                                                 org.datanucleus.store.mapped.DatastoreIdentifier candidateAlias)
Create a query to search for the candidateClass and subclasses if true

Specified by:
newQueryStatement in interface org.datanucleus.store.mapped.expression.Queryable
Parameters:
candidateClass - The candidate
candidateAlias - Alias for the candidate
Returns:
The new QueryStatement

setHasAggregatedExpressionsOnly

public void setHasAggregatedExpressionsOnly(boolean flag)
Convenience method to set if we know there are only aggregate expressions and so can ignore any checks on the result expressions. This is typically called where we haven't done a full compile of the result just scanning for aggregate keywords, allowing us to generate the QueryStatement correctly.

Parameters:
flag - Whether we just have aggregates

setResultExpressions

public void setResultExpressions(org.datanucleus.store.mapped.expression.ScalarExpression[] expressions)
Parameters:
expressions - The expressions to set.

getResultExpressions

public org.datanucleus.store.mapped.expression.ScalarExpression[] getResultExpressions()
Returns:
The expressions to project.

hasAggregatedExpressionsOnly

public boolean hasAggregatedExpressionsOnly()
Whether only aggregated expressions are returned

Returns:
Whether it has only aggregate expressions

newResultObjectFactory

public org.datanucleus.store.query.ResultObjectFactory newResultObjectFactory(org.datanucleus.store.mapped.expression.QueryExpression stmt,
                                                                              boolean ignoreCache,
                                                                              java.lang.Class resultClass,
                                                                              boolean useFetchPlan)
Specified by:
newResultObjectFactory in interface org.datanucleus.store.mapped.expression.Queryable

isEmpty

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

Specified by:
isEmpty in interface org.datanucleus.store.mapped.expression.Queryable
Returns:
true if this collection contains no elements.


Copyright © 2009. All Rights Reserved.