EclipseLink 2.2.0, build 'v20110202-r8913' API Reference

org.eclipse.persistence.queries
Class ReportQuery

java.lang.Object
  extended by org.eclipse.persistence.queries.DatabaseQuery
      extended by org.eclipse.persistence.queries.ReadQuery
          extended by org.eclipse.persistence.queries.ObjectBuildingQuery
              extended by org.eclipse.persistence.queries.ObjectLevelReadQuery
                  extended by org.eclipse.persistence.queries.ReadAllQuery
                      extended by org.eclipse.persistence.queries.ReportQuery
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class ReportQuery
extends ReadAllQuery

Purpose: Query for information about a set of objects instead of the objects themselves. This supports select single attributes, nested attributes, aggregation functions and group bys.

Attribute Types:

  1. addAttribute("directQueryKey") is a short cut method to add an attribute with the same name as its corresponding direct query key.
  2. addAttribute("attributeName", expBuilder.get("oneToOneMapping").get("directQueryKey")) is the full approach for get values through joined 1:1 relationships.
  3. addAttribute("attributeName", expBuilder.getField("TABLE.FIELD")) allows the addition of raw values or values which were not mapped in the object model directly (i.e. FK attributes).
  4. addAttribute("attributeName", null) Leave a place holder (NULL) value in the result (used for included values from other systems or calculated values).
Retrieving Primary Keys: It is possible to retrieve the primary key raw values within each result, but stored in a separate (internal) vector. This primary key vector can later be used to retrieve the real object.

See Also:
retrievePrimaryKeys(), If the values are wanted in the result array then they must be added as attributes. For primary keys which are not mapped directly you can add them as DatabaseFields (see above)., Serialized Form
Author:
Doug Clarke
Since:
TOPLink/Java 2.0

Field Summary
protected  boolean addToConstructorItem
          flag to allow items to be added to the last ConstructorReportItem
static int FIRST_PRIMARY_KEY
           
static int FULL_PRIMARY_KEY
          Specifies whether to retrieve primary keys, first primary key, or no primary key.
protected  java.util.List<Expression> groupByExpressions
          Expressions representing fields to be used in the GROUP BY clause.
protected  Expression havingExpression
          Expression representing the HAVING clause.
protected  java.util.List<org.eclipse.persistence.internal.queries.ReportItem> items
          Items to be selected, these could be attributes or aggregate functions.
protected  java.util.List<java.lang.String> names
          Collection of names for use by results.
static int NO_PRIMARY_KEY
           
protected static java.lang.Boolean RESULT_IGNORED
           
protected  int returnChoice
          Can be one of (ShouldReturnSingleResult, ShouldReturnSingleValue, ShouldReturnSingleAttribute) Simplifies the result by only returning the first result, first value, or all attribute values
protected  java.util.Set<java.lang.Object> returnedKeys
           
protected  int shouldRetrievePrimaryKeys
          Flag indicating whether the primary key values should also be retrieved for the reference class.
static int ShouldReturnArray
          For EJB 3 support returns results as an Object array.
static int ShouldReturnReportResult
          Default, returns ReportQueryResult objects.
static int ShouldReturnSingleAttribute
          Simplifies the result by only returning the single attribute(as opposed to wrapping in a ReportQueryResult).
static int ShouldReturnSingleResult
          Simplifies the result by only returning the first result.
static int ShouldReturnSingleValue
          Simplifies the result by only returning one value.
static int ShouldReturnWithoutReportQueryResult
          For EJB 3 support returns results without using the ReportQueryResult
static int ShouldSelectValue1
          For example, ...
 
Fields inherited from class org.eclipse.persistence.queries.ReadAllQuery
connectByExpression, containerPolicy, orderSiblingsByExpressions, startWithExpression
 
Fields inherited from class org.eclipse.persistence.queries.ObjectLevelReadQuery
additionalFields, batchFetchPolicy, cacheUsage, CheckCacheByExactPrimaryKey, CheckCacheByPrimaryKey, CheckCacheOnly, CheckCacheThenDatabase, concreteSubclassCalls, ConformResultsInUnitOfWork, defaultBuilder, distinctState, DoNotCheckCache, DONT_USE_DISTINCT, entityFetchGroup, fetchGroup, fetchGroupName, inMemoryQueryIndirectionPolicy, isPrePrepared, isReadOnly, isReferenceClassLocked, isResultSetOptimizedQuery, joinedAttributeManager, loadGroup, lockModeType, NONE, nonFetchJoinAttributeExpressions, OPTIMISTIC, OPTIMISTIC_FORCE_INCREMENT, orderByExpressions, partialAttributeExpressions, PESSIMISTIC_, PESSIMISTIC_FORCE_INCREMENT, PESSIMISTIC_READ, PESSIMISTIC_WRITE, READ, shouldExtendPessimisticLockScope, shouldIncludeData, shouldOuterJoinSubclasses, shouldUseDefaultFetchGroup, UNCOMPUTED_DISTINCT, USE_DISTINCT, UseDescriptorSetting, waitTimeout, WRITE
 
Fields inherited from class org.eclipse.persistence.queries.ObjectBuildingQuery
DEFAULT_LOCK_MODE, executionTime, LOCK, LOCK_NOWAIT, LOCK_RESULT_PROPERTY, lockingClause, NO_LOCK, referenceClass, referenceClassName, requiresDeferredLocks, shouldBuildNullForNullPk, shouldRefreshIdentityMapResult, shouldRefreshRemoteIdentityMapResult, shouldRegisterResultsInUnitOfWork, shouldUseExclusiveConnection, wasDefaultLockMode
 
Fields inherited from class org.eclipse.persistence.queries.ReadQuery
fetchSize, firstResult, maxRows, queryId, queryResultCachingPolicy, temporaryCachedQueryResults
 
Fields inherited from class org.eclipse.persistence.queries.DatabaseQuery
accessors, argumentFields, arguments, argumentTypeNames, argumentTypes, argumentValues, BATCH_FETCH_PROPERTY, CascadeAggregateDelete, CascadeAllParts, CascadeByMapping, CascadeDependentParts, cascadePolicy, CascadePrivateParts, descriptor, doNotRedirect, executionSession, flushOnExecute, hintString, isCustomQueryUsed, isExecutionClone, isNativeConnectionRequired, isPrepared, isUserDefined, monitorName, name, NoCascading, parameterDelimiter, partitioningPolicy, properties, queryMechanism, queryTimeout, redirector, session, sessionName, shouldBindAllParameters, shouldCacheStatement, shouldCloneCall, shouldMaintainCache, shouldPrepare, shouldRetrieveBypassCache, shouldStoreBypassCache, shouldUseWrapperPolicy, shouldValidateUpdateCallCacheUse, sourceMapping, translationRow
 
Constructor Summary
ReportQuery()
          INTERNAL: The builder should be provided.
ReportQuery(java.lang.Class javaClass, Expression expression)
           
ReportQuery(java.lang.Class javaClass, ExpressionBuilder builder)
          PUBLIC: The report query is require to be constructor with an expression builder.
ReportQuery(ExpressionBuilder builder)
          PUBLIC: The report query is require to be constructor with an expression builder.
 
Method Summary
 void addAttribute(java.lang.String itemName)
          PUBLIC: Add the attribute from the reference class to be included in the result.
 void addAttribute(java.lang.String itemName, Expression attributeExpression)
          PUBLIC: Add the attribute to be included in the result.
 void addAttribute(java.lang.String itemName, Expression attributeExpression, java.lang.Class type)
          PUBLIC: Add the attribute to be included in the result.
 void addAverage(java.lang.String itemName)
          PUBLIC: Add the average value of the attribute to be included in the result.
 void addAverage(java.lang.String itemName, java.lang.Class resultType)
          PUBLIC: Add the average value of the attribute to be included in the result and return it as the specified resultType.
 void addAverage(java.lang.String itemName, Expression attributeExpression)
          PUBLIC: Add the average value of the attribute to be included in the result.
 void addAverage(java.lang.String itemName, Expression attributeExpression, java.lang.Class resultType)
          PUBLIC: Add the average value of the attribute to be included in the result and return it as the specified resultType.
 void addConstructorReportItem(ConstructorReportItem item)
          PUBLIC: Add a ConstructorReportItem to this query's set of return values.
 void addCount()
          PUBLIC: Include the number of rows returned by the query in the result.
 void addCount(java.lang.String attributeName)
          PUBLIC: Include the number of rows returned by the query in the result, where attributeExpression is not null.
 void addCount(java.lang.String attributeName, java.lang.Class resultType)
          PUBLIC: Include the number of rows returned by the query in the result, where attributeExpression is not null.
 void addCount(java.lang.String itemName, Expression attributeExpression)
          PUBLIC: Include the number of rows returned by the query in the result, where attributeExpression is not null.
 void addCount(java.lang.String itemName, Expression attributeExpression, java.lang.Class resultType)
          PUBLIC: Include the number of rows returned by the query in the result, where attributeExpression is not null.
 void addFunctionItem(java.lang.String itemName, Expression attributeExpression, java.lang.String functionName)
          ADVANCED: Add the function against the attribute expression to be included in the result.
 void addGrouping(Expression expression)
          PUBLIC: Add the attribute expression to the group by expressions.
 void addGrouping(java.lang.String attributeName)
          PUBLIC: Add the attribute to the group by expressions.
 void addItem(java.lang.String itemName, Expression attributeExpression)
          ADVANCED: Add the expression value to be included in the result.
protected  void addItem(java.lang.String itemName, Expression attributeExpression, java.lang.Class resultType)
          INTERNAL: Add the expression value to be included in the result.
 void addItem(java.lang.String itemName, Expression attributeExpression, java.util.List joinedExpressions)
          ADVANCED: Add the expression value to be included in the result.
 void addMaximum(java.lang.String itemName)
          PUBLIC: Add the maximum value of the attribute to be included in the result.
 void addMaximum(java.lang.String itemName, Expression attributeExpression)
          PUBLIC: Add the maximum value of the attribute to be included in the result.
 void addMinimum(java.lang.String itemName)
          PUBLIC: Add the minimum value of the attribute to be included in the result.
 void addMinimum(java.lang.String itemName, Expression attributeExpression)
          PUBLIC: Add the minimum value of the attribute to be included in the result.
 void addStandardDeviation(java.lang.String itemName)
          PUBLIC: Add the standard deviation value of the attribute to be included in the result.
 void addStandardDeviation(java.lang.String itemName, Expression attributeExpression)
          PUBLIC: Add the standard deviation value of the attribute to be included in the result.
 void addSum(java.lang.String itemName)
          PUBLIC: Add the sum value of the attribute to be included in the result.
 void addSum(java.lang.String itemName, java.lang.Class resultType)
          PUBLIC: Add the sum value of the attribute to be included in the result and return it as the specified resultType.
 void addSum(java.lang.String itemName, Expression attributeExpression)
          PUBLIC: Add the sum value of the attribute to be included in the result.
 void addSum(java.lang.String itemName, Expression attributeExpression, java.lang.Class resultType)
          PUBLIC: Add the sum value of the attribute to be included in the result and return it as the specified resultType.
 void addVariance(java.lang.String itemName)
          PUBLIC: Add the variance value of the attribute to be included in the result.
 void addVariance(java.lang.String itemName, Expression attributeExpression)
          PUBLIC: Add the variance value of the attribute to be included in the result.
 ConstructorReportItem beginAddingConstructorArguments(java.lang.Class constructorClass)
          PUBLIC: Call a constructor for the given class with the results of this query.
 ConstructorReportItem beginAddingConstructorArguments(java.lang.Class constructorClass, java.lang.Class[] constructorArgTypes)
          PUBLIC: Call a constructor for the given class with the results of this query.
 java.lang.Object buildObject(org.eclipse.persistence.internal.sessions.AbstractRecord row)
          INTERNAL: By default return the row.
 java.lang.Object buildObject(org.eclipse.persistence.internal.sessions.AbstractRecord row, java.util.Vector toManyJoinData)
          INTERNAL: Construct a result from a row.
 java.lang.Object buildObjects(java.util.Vector rows)
          INTERNAL: Construct a container of ReportQueryResult from the rows.
protected  java.lang.Object checkEarlyReturnLocal(org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)
          INTERNAL: The cache check is done before the prepare as a hit will not require the work to be done.
protected  DatabaseQuery checkForCustomQuery(org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)
          INTERNAL: Check to see if a custom query should be used for this query.
 void clearItems()
          INTERNAL: Clear the ReportQueryItems
 java.lang.Object clone()
          INTERNAL: Clone the query.
 void copyReportItems(java.util.Map alreadyDone)
          INTERNAL: Required for a very special case of bug 2612185: ReportItems from parallelExpressions, on a ReportQuery which is a subQuery, which is being batch read.
 void dontRetrievePrimaryKeys()
          PUBLIC: Set if the query results should contain the primary keys or each associated object.
 void dontReturnSingleAttribute()
          PUBLIC: Don't simplify the result by returning the single attribute.
 void dontReturnSingleResult()
          PUBLIC: Simplifies the result by only returning the first result.
 void dontReturnSingleValue()
          PUBLIC: Simplifies the result by only returning a single value.
 void dontReturnWithoutReportQueryResult()
          PUBLIC: Simplifies the result by only returning a single value.
 void endAddingToConstructorItem()
          PUBLIC: Used in conjunction with beginAddingConstructorArguments to signal that expressions should no longer be be added to the collection used in the constructor.
 boolean equals(java.lang.Object object)
          INTERNAL: Return if the query is equal to the other.
 java.lang.Object executeDatabaseQuery()
          INTERNAL: Execute the query.
 java.lang.Object extractRemoteResult(org.eclipse.persistence.internal.sessions.remote.Transporter transporter)
          INTERNAL: Extract the correct query result from the transporter.
protected  QueryRedirector getDefaultRedirector()
          INTERNAL: Returns the specific default redirector for this query type.
 java.util.List<Expression> getGroupByExpressions()
          INTERNAL: Return the group bys.
 Expression getHavingExpression()
          INTERNAL: Return the Having expression.
 java.util.List<org.eclipse.persistence.internal.queries.ReportItem> getItems()
          INTERNAL:
 java.util.List<java.lang.String> getNames()
          INTERNAL: Lazily initialize and return the names of the items requested for use in each result object.
 java.util.Vector getQueryExpressions()
          INTERNAL: return a collection of expressions if PK's are used.
 int getReturnType()
          PUBLIC: Return the return type.
 boolean hasGroupByExpressions()
          INTERNAL: Return if any group bys exist, allow lazy initialization.
 void initializeFetchGroup()
          INTERNAL: Avoid processing fetch-groups for report query.
 boolean isDefaultPropertiesQuery()
          INTERNAL: Return true if the query uses default properties.
 boolean isReportQuery()
          PUBLIC: Return if this is a report query.
protected  void prepare()
          INTERNAL: Prepare the receiver for execution in a session.
 void prepareFetchGroup()
          INTERNAL: ReportQuery doesn't support fetch groups.
 void prepareFromQuery(DatabaseQuery query)
          INTERNAL: Prepare the query from the prepared query.
protected  void prepareObjectAttributeCount(java.util.Map clonedExpressions)
          INTERNAL: Prepare a report query with a count defined on an object attribute.
protected  void prepareSelectAllRows()
          INTERNAL: Prepare the mechanism.
 void prepareSubSelect(org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, java.util.Map clonedExpressions)
          INTERNAL: Prepare the receiver for being printed inside a subselect.
 java.util.Map replaceValueHoldersIn(java.lang.Object object, org.eclipse.persistence.internal.sessions.remote.RemoteSessionController controller)
          INTERNAL: replace the value holders in the specified result object(s)
 void retrievePrimaryKeys()
          PUBLIC: Set if the query results should contain the primary keys or each associated object.
 void returnSingleAttribute()
          PUBLIC: Simplify the result by returning a single attribute.
 void returnSingleResult()
          PUBLIC: Simplifies the result by only returning the first result.
 void returnSingleValue()
          PUBLIC: Simplifies the result by only returning a single value.
 void returnWithoutReportQueryResult()
          PUBLIC: Simplifies the result by only returning a single value.
 void selectValue1()
          PUBLIC: Simplifies the result by only returning a single value.
protected  void setGroupByExpressions(java.util.List<Expression> groupByExpressions)
          INTERNAL: Set the group bys.
 void setHavingExpression(Expression expression)
          PUBLIC: Add the expression to the query to be used in the HAVING clause.
protected  void setItems(java.util.List<org.eclipse.persistence.internal.queries.ReportItem> items)
          INTERNAL: Set the ReportQueryItems defining the attributes to be read.
 boolean setLockModeType(java.lang.String lockModeType, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Sets a javax.persistence.LockModeType to used with this queries execution.
protected  void setNames(java.util.List<java.lang.String> names)
          INTERNAL: Set the item names.
 void setReturnType(int returnChoice)
          PUBLIC: Set the return type.
 void setShouldRetrieveFirstPrimaryKey(boolean shouldRetrieveFirstPrimaryKey)
          ADVANCED: Sets if the query results should contain the first primary key of each associated object.
 void setShouldRetrievePrimaryKeys(boolean shouldRetrievePrimaryKeys)
          PUBLIC: Set if the query results should contain the primary keys or each associated object.
 void setShouldReturnSingleAttribute(boolean newChoice)
          PUBLIC: Simplifies the result by only returning the attribute (as opposed to wrapping in a ReportQueryResult).
 void setShouldReturnSingleResult(boolean newChoice)
          PUBLIC: Simplifies the result by only returning the first result.
 void setShouldReturnSingleValue(boolean newChoice)
          PUBLIC: Simplifies the result by only returning a single value.
 void setShouldReturnWithoutReportQueryResult(boolean newChoice)
          PUBLIC: Simplifies the result by returning a nested list instead of the ReportQueryResult.
 boolean shouldRetrieveFirstPrimaryKey()
          PUBLIC: Return if the query results should contain the first primary key of each associated object.
 boolean shouldRetrievePrimaryKeys()
          PUBLIC: Return if the query results should contain the primary keys or each associated object.
 boolean shouldReturnArray()
          PUBLIC: Returns true if results should be returned as an Object array.
 boolean shouldReturnSingleAttribute()
          PUBLIC: Answer if we are only returning the attribute (as opposed to wrapping in a ReportQueryResult).
 boolean shouldReturnSingleResult()
          PUBLIC: Simplifies the result by only returning the first result.
 boolean shouldReturnSingleValue()
          PUBLIC: Simplifies the result by only returning a single value.
 boolean shouldReturnWithoutReportQueryResult()
          PUBLIC: Simplifies the result by returning a nested list instead of the ReportQueryResult.
 boolean shouldSelectValue1()
          PUBLIC: Returns true if results should be returned as an Object array.
 
Methods inherited from class org.eclipse.persistence.queries.ReadAllQuery
addAscendingOrdering, cacheResult, conformResult, execute, executeObjectLevelReadQuery, executeObjectLevelReadQueryFromResultSet, getConnectByExpression, getContainerPolicy, getOrderSiblingsByExpressions, getStartWithExpression, hasHierarchicalExpressions, isReadAllQuery, prepareCustomQuery, prepareForExecution, registerResultInUnitOfWork, remoteExecute, setContainerPolicy, setHierarchicalQueryClause, useCollectionClass, useCursoredStream, useCursoredStream, useCursoredStream, useMapClass, useScrollableCursor, useScrollableCursor, useScrollableCursor
 
Methods inherited from class org.eclipse.persistence.queries.ObjectLevelReadQuery
acquireLocks, acquireLocksWithoutWaiting, addAdditionalField, addAdditionalField, addBatchReadAttribute, addBatchReadAttribute, addDescendingOrdering, addJoinedAttribute, addJoinedAttribute, addJoinSelectionFields, addNonFetchJoinedAttribute, addNonFetchJoinedAttribute, addOrdering, addPartialAttribute, addPartialAttribute, addSelectionFieldsForJoinedExpression, changeDescriptor, checkCacheOnly, checkDescriptor, checkEarlyReturn, checkPrepare, checkPrePrepare, computeBatchReadMappingQueries, computeNestedQueriesForBatchReadExpressions, conformIndividualResult, conformResultsInUnitOfWork, copyFromQuery, deepClone, dontAcquireLocks, dontCheckCache, dontRefreshIdentityMapResult, dontRefreshRemoteIdentityMapResult, dontUseDistinct, executeInUnitOfWork, extendPessimisticLockScope, getAdditionalFields, getAsOfClause, getBatchFetchPolicy, getBatchObjects, getBatchReadAttributeExpressions, getCacheUsage, getConcreteSubclassCalls, getDistinctState, getEntityFetchGroup, getExampleObject, getExecutionFetchGroup, getExpressionBuilder, getFetchGroup, getFetchGroupName, getFetchGroupNonNestedFieldsSet, getFetchGroupNonNestedFieldsSet, getFetchGroupSelectionFields, getFetchGroupSelectionFields, getInMemoryQueryIndirectionPolicy, getInMemoryQueryIndirectionPolicyState, getJoinedAttributeExpressions, getJoinedAttributeManager, getLeafDescriptorFor, getLeafMappingFor, getLoadGroup, getLockingClause, getLockMode, getNonFetchJoinAttributeExpressions, getOrderByExpressions, getPartialAttributeExpressions, getPartialAttributeSelectionFields, getQueryByExamplePolicy, getReferenceClass, getReferenceClassName, getSelectionFields, getWaitTimeout, hasAdditionalFields, hasAsOfClause, hasBatchReadAttributes, hasDefaultBuilder, hasExecutionFetchGroup, hasFetchGroup, hashCode, hasJoining, hasNonFetchJoinedAttributeExpressions, hasOrderByExpressions, hasPartialAttributeExpressions, initializeDefaultBuilder, isAttributeBatchRead, isClonePessimisticLocked, isDefaultLock, isDistinctComputed, isLockQuery, isLockQuery, isObjectLevelReadQuery, isPartialAttribute, isPrePrepared, isPrimaryKeyQuery, isReadOnly, isReferenceClassLocked, isResultSetOptimizedQuery, prepareForRemoteExecution, prepareFromCachedQuery, prepareOutsideUnitOfWork, prepareQuery, prePrepare, recordCloneForPessimisticLocking, refreshIdentityMapResult, refreshRemoteIdentityMapResult, resetDistinct, setAdditionalFields, setAsOfClause, setBatchFetchPolicy, setBatchFetchSize, setBatchFetchType, setBatchObjects, setBatchReadAttributeExpressions, setCacheUsage, setDescriptor, setDistinctState, setEJBQLString, setExampleObject, setExpressionBuilder, setFetchGroup, setFetchGroupName, setInMemoryQueryIndirectionPolicy, setInMemoryQueryIndirectionPolicyState, setIsPrepared, setIsPrePrepared, setIsReadOnly, setIsResultSetOptimizedQuery, setJoinedAttributeExpressions, setJoinedAttributeManager, setLoadGroup, setLockingClause, setLockMode, setNonFetchJoinAttributeExpressions, setOrderByExpressions, setPartialAttributeExpressions, setQueryByExamplePolicy, setReferenceClass, setReferenceClassName, setSelectionCriteria, setShouldExtendPessimisticLockScope, setShouldFilterDuplicates, setShouldIncludeData, setShouldOuterJoinSubclasses, setShouldUseDefaultFetchGroup, setWaitTimeout, setWasDefaultLockMode, shouldCheckCache, shouldCheckCacheOnly, shouldCheckDescriptorForCacheUsage, shouldConformResultsInUnitOfWork, shouldDistinctBeUsed, shouldExtendPessimisticLockScope, shouldFilterDuplicates, shouldIncludeData, shouldOuterJoinSubclasses, shouldReadAllMappings, shouldReadMapping, shouldUseDefaultFetchGroup, toString, useDistinct, wasDefaultLockMode
 
Methods inherited from class org.eclipse.persistence.queries.ObjectBuildingQuery
convertClassNamesToClasses, getDataResults, getExecutionTime, isAttributeJoined, isObjectBuildingQuery, isRegisteringResults, postRegisterIndividualResult, registerIndividualResult, requiresDeferredLocks, setExecutionTime, setRequiresDeferredLocks, setShouldBuildNullForNullPk, setShouldRefreshIdentityMapResult, setShouldRefreshRemoteIdentityMapResult, setShouldRegisterResultsInUnitOfWork, setShouldUseExclusiveConnection, shouldBuildNullForNullPk, shouldRefreshIdentityMapResult, shouldRefreshRemoteIdentityMapResult, shouldRegisterResultsInUnitOfWork, shouldUseExclusiveConnection
 
Methods inherited from class org.eclipse.persistence.queries.ReadQuery
cacheQueryResults, clearQueryResults, clonedQueryExecutionComplete, doNotCacheQueryResults, getFetchSize, getFirstResult, getMaxRows, getQueryId, getQueryResults, getQueryResults, getQueryResults, getQueryResultsCachePolicy, getTemporaryCachedQueryResults, isReadQuery, remoteExecute, setFetchSize, setFirstResult, setMaxRows, setQueryId, setQueryResults, setQueryResultsCachePolicy, setTemporaryCachedQueryResults, shouldCacheQueryResults
 
Methods inherited from class org.eclipse.persistence.queries.DatabaseQuery
addArgument, addArgument, addArgument, addArgumentByTypeName, addArgumentValue, addArgumentValues, addCall, addStatement, bindAllParameters, buildArgumentFields, buildSelectionCriteria, cacheStatement, cascadeAllParts, cascadeByMapping, cascadeOnlyDependentParts, cascadePrivateParts, checkPrepare, dontBindAllParameters, dontCacheStatement, dontCascadeParts, dontMaintainCache, getAccessor, getAccessors, getArguments, getArgumentTypeNames, getArgumentTypes, getArgumentValues, getCall, getCascadePolicy, getDatasourceCall, getDatasourceCalls, getDescriptor, getDoNotRedirect, getEJBQLString, getExecutionSession, getFlushOnExecute, getHintString, getJPQLString, getMonitorName, getName, getParameterDelimiter, getParameterDelimiterChar, getPartitioningPolicy, getProperties, getProperty, getQueryMechanism, getQueryTimeout, getRedirector, getSelectionCriteria, getSession, getSessionName, getShouldBindAllParameters, getSourceMapping, getSQLStatement, getSQLString, getSQLStrings, getTranslatedSQLString, getTranslatedSQLStrings, getTranslationRow, hasAccessor, hasArguments, hasProperties, hasQueryMechanism, hasSessionName, ignoreBindAllParameters, ignoreCacheStatement, isCallQuery, isCascadeOfAggregateDelete, isCustomQueryUsed, isCustomSelectionQuery, isDataModifyQuery, isDataReadQuery, isDeleteAllQuery, isDeleteObjectQuery, isDirectReadQuery, isExecutionClone, isExpressionQuery, isInsertObjectQuery, isJPQLCallQuery, isModifyAllQuery, isModifyQuery, isNativeConnectionRequired, isObjectLevelModifyQuery, isPrepared, isReadObjectQuery, isSQLCallQuery, isUpdateAllQuery, isUpdateObjectQuery, isUserDefined, isValueReadQuery, isWriteObjectQuery, maintainCache, prepareCall, redirectQuery, removeProperty, resetMonitorName, retrieveBypassCache, rowFromArguments, setAccessor, setAccessors, setArguments, setArgumentTypeNames, setArgumentTypes, setArgumentValues, setCall, setCascadePolicy, setDatasourceCall, setDoNotRedirect, setExecutionSession, setFlushOnExecute, setHintString, setIsCustomQueryUsed, setIsExecutionClone, setIsNativeConnectionRequired, setIsUserDefined, setJPQLString, setName, setParameterDelimiter, setPartitioningPolicy, setProperties, setProperty, setQueryMechanism, setQueryTimeout, setRedirector, setSession, setSessionName, setShouldBindAllParameters, setShouldBindAllParameters, setShouldCacheStatement, setShouldMaintainCache, setShouldPrepare, setShouldRetrieveBypassCache, setShouldStoreBypassCache, setShouldUseWrapperPolicy, setShouldValidateUpdateCallCacheUse, setSourceMapping, setSQLStatement, setSQLString, setTranslationRow, shouldBindAllParameters, shouldCacheStatement, shouldCascadeAllParts, shouldCascadeByMapping, shouldCascadeOnlyDependentParts, shouldCascadeParts, shouldCascadePrivateParts, shouldCloneCall, shouldIgnoreBindAllParameters, shouldIgnoreCacheStatement, shouldMaintainCache, shouldPrepare, shouldRetrieveBypassCache, shouldStoreBypassCache, shouldUseWrapperPolicy, shouldValidateUpdateCallCacheUse, storeBypassCache
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ShouldReturnReportResult

public static final int ShouldReturnReportResult
Default, returns ReportQueryResult objects.

See Also:
Constant Field Values

ShouldReturnSingleResult

public static final int ShouldReturnSingleResult
Simplifies the result by only returning the first result.

See Also:
Constant Field Values

ShouldReturnSingleValue

public static final int ShouldReturnSingleValue
Simplifies the result by only returning one value.

See Also:
Constant Field Values

ShouldReturnSingleAttribute

public static final int ShouldReturnSingleAttribute
Simplifies the result by only returning the single attribute(as opposed to wrapping in a ReportQueryResult).

See Also:
Constant Field Values

ShouldReturnWithoutReportQueryResult

public static final int ShouldReturnWithoutReportQueryResult
For EJB 3 support returns results without using the ReportQueryResult

See Also:
Constant Field Values

ShouldReturnArray

public static final int ShouldReturnArray
For EJB 3 support returns results as an Object array.

See Also:
Constant Field Values

ShouldSelectValue1

public static final int ShouldSelectValue1
For example, ... EXISTS( SELECT 1 FROM ...

See Also:
Constant Field Values

FULL_PRIMARY_KEY

public static final int FULL_PRIMARY_KEY
Specifies whether to retrieve primary keys, first primary key, or no primary key.

See Also:
Constant Field Values

FIRST_PRIMARY_KEY

public static final int FIRST_PRIMARY_KEY
See Also:
Constant Field Values

NO_PRIMARY_KEY

public static final int NO_PRIMARY_KEY
See Also:
Constant Field Values

RESULT_IGNORED

protected static final java.lang.Boolean RESULT_IGNORED

shouldRetrievePrimaryKeys

protected int shouldRetrievePrimaryKeys
Flag indicating whether the primary key values should also be retrieved for the reference class.


names

protected java.util.List<java.lang.String> names
Collection of names for use by results.


items

protected java.util.List<org.eclipse.persistence.internal.queries.ReportItem> items
Items to be selected, these could be attributes or aggregate functions.


groupByExpressions

protected java.util.List<Expression> groupByExpressions
Expressions representing fields to be used in the GROUP BY clause.


havingExpression

protected Expression havingExpression
Expression representing the HAVING clause.


returnChoice

protected int returnChoice
Can be one of (ShouldReturnSingleResult, ShouldReturnSingleValue, ShouldReturnSingleAttribute) Simplifies the result by only returning the first result, first value, or all attribute values


addToConstructorItem

protected boolean addToConstructorItem
flag to allow items to be added to the last ConstructorReportItem


returnedKeys

protected java.util.Set<java.lang.Object> returnedKeys
Constructor Detail

ReportQuery

public ReportQuery()
INTERNAL: The builder should be provided.


ReportQuery

public ReportQuery(java.lang.Class javaClass,
                   Expression expression)

ReportQuery

public ReportQuery(java.lang.Class javaClass,
                   ExpressionBuilder builder)
PUBLIC: The report query is require to be constructor with an expression builder. This build must be used for the selection critiera, any item expressions, group bys and order bys.


ReportQuery

public ReportQuery(ExpressionBuilder builder)
PUBLIC: The report query is require to be constructor with an expression builder. This build must be used for the selection critiera, any item expressions, group bys and order bys.

Method Detail

addAttribute

public void addAttribute(java.lang.String itemName)
PUBLIC: Add the attribute from the reference class to be included in the result. EXAMPLE: reportQuery.addAttribute("firstName");


addAttribute

public void addAttribute(java.lang.String itemName,
                         Expression attributeExpression)
PUBLIC: Add the attribute to be included in the result. EXAMPLE: reportQuery.addAttribute("city", expBuilder.get("address").get("city"));


addAttribute

public void addAttribute(java.lang.String itemName,
                         Expression attributeExpression,
                         java.lang.Class type)
PUBLIC: Add the attribute to be included in the result. Return the result as the provided class EXAMPLE: reportQuery.addAttribute("city", expBuilder.get("period").get("startTime"), Time.class);


addAverage

public void addAverage(java.lang.String itemName)
PUBLIC: Add the average value of the attribute to be included in the result. Aggregation functions can be used with a group by, or on the entire result set. EXAMPLE: reportQuery.addAverage("salary");


addAverage

public void addAverage(java.lang.String itemName,
                       java.lang.Class resultType)
PUBLIC: Add the average value of the attribute to be included in the result and return it as the specified resultType. Aggregation functions can be used with a group by, or on the entire result set. EXAMPLE: reportQuery.addAverage("salary", Float.class);


addAverage

public void addAverage(java.lang.String itemName,
                       Expression attributeExpression)
PUBLIC: Add the average value of the attribute to be included in the result. Aggregation functions can be used with a group by, or on the entire result set. EXAMPLE: reportQuery.addAverage("managerSalary", expBuilder.get("manager").get("salary"));


addAverage

public void addAverage(java.lang.String itemName,
                       Expression attributeExpression,
                       java.lang.Class resultType)
PUBLIC: Add the average value of the attribute to be included in the result and return it as the specified resultType. Aggregation functions can be used with a group by, or on the entire result set. EXAMPLE: reportQuery.addAverage("managerSalary", expBuilder.get("manager").get("salary"), Double.class);


addConstructorReportItem

public void addConstructorReportItem(ConstructorReportItem item)
PUBLIC: Add a ConstructorReportItem to this query's set of return values.

Parameters:
ConstructorReportItem - - used to specify a class constructor and values to pass in from this query
See Also:
ConstructorReportItem

addCount

public void addCount()
PUBLIC: Include the number of rows returned by the query in the result. Aggregation functions can be used with a group by, or on the entire result set. EXAMPLE: Java: reportQuery.addCount(); SQL: SELECT COUNT (*) FROM ...

See Also:
addCount(java.lang.String)

addCount

public void addCount(java.lang.String attributeName)
PUBLIC: Include the number of rows returned by the query in the result, where attributeExpression is not null. Aggregation functions can be used with a group by, or on the entire result set.

Example:

TopLink: reportQuery.addCount("id"); SQL: SELECT COUNT (t0.EMP_ID) FROM EMPLOYEE t0, ...

Parameters:
attributeName - the number of rows where attributeName is not null will be returned.
See Also:
addCount(java.lang.String, org.eclipse.persistence.expressions.Expression)

addCount

public void addCount(java.lang.String attributeName,
                     java.lang.Class resultType)
PUBLIC: Include the number of rows returned by the query in the result, where attributeExpression is not null. Aggregation functions can be used with a group by, or on the entire result set. Set the count to be returned as the specified resultType.

Example:

TopLink: reportQuery.addCount("id", Long.class); SQL: SELECT COUNT (t0.EMP_ID) FROM EMPLOYEE t0, ...

Parameters:
attributeName - the number of rows where attributeName is not null will be returned.
See Also:
addCount(java.lang.String, org.eclipse.persistence.expressions.Expression)

addCount

public void addCount(java.lang.String itemName,
                     Expression attributeExpression)
PUBLIC: Include the number of rows returned by the query in the result, where attributeExpression is not null. Aggregation functions can be used with a group by, or on the entire result set.

Example:

TopLink: reportQuery.addCount("Count", getExpressionBuilder().get("id")); SQL: SELECT COUNT (t0.EMP_ID) FROM EMPLOYEE t0, ...

Example: counting only distinct values of an attribute.

TopLink: reportQuery.addCount("Count", getExpressionBuilder().get("address").distinct()); SQL: SELECT COUNT (DISTINCT t0.ADDR_ID) FROM EMPLOYEE t0, ...
objectAttributes can be specified also, even accross many to many mappings.

See Also:
addCount()

addCount

public void addCount(java.lang.String itemName,
                     Expression attributeExpression,
                     java.lang.Class resultType)
PUBLIC: Include the number of rows returned by the query in the result, where attributeExpression is not null. Aggregation functions can be used with a group by, or on the entire result set. Set the count to be returned as the specified resultType.

Example:

TopLink: reportQuery.addCount("Count", getExpressionBuilder().get("id"), Integer.class); SQL: SELECT COUNT (t0.EMP_ID) FROM EMPLOYEE t0, ...

Example: counting only distinct values of an attribute.

TopLink: reportQuery.addCount("Count", getExpressionBuilder().get("address").distinct()); SQL: SELECT COUNT (DISTINCT t0.ADDR_ID) FROM EMPLOYEE t0, ...
objectAttributes can be specified also, even accross many to many mappings.

See Also:
addCount()

addFunctionItem

public void addFunctionItem(java.lang.String itemName,
                            Expression attributeExpression,
                            java.lang.String functionName)
ADVANCED: Add the function against the attribute expression to be included in the result. Aggregation functions can be used with a group by, or on the entire result set. Example: reportQuery.addFunctionItem("average", expBuilder.get("salary"), "average");


addGrouping

public void addGrouping(java.lang.String attributeName)
PUBLIC: Add the attribute to the group by expressions. This will group the result set on that attribute and is normally used in conjunction with aggregation functions. Example: reportQuery.addGrouping("lastName")


addGrouping

public void addGrouping(Expression expression)
PUBLIC: Add the attribute expression to the group by expressions. This will group the result set on that attribute and is normally used in conjunction with aggregation functions. Example: reportQuery.addGrouping(expBuilder.get("address").get("country"))


setHavingExpression

public void setHavingExpression(Expression expression)
PUBLIC: Add the expression to the query to be used in the HAVING clause. This epression will be used to filter the result sets after they are grouped. It must be used in conjunction with the GROUP BY clause.

Example:

reportQuery.setHavingExpression(expBuilder.get("address").get("country").equal("Canada"))


addItem

public void addItem(java.lang.String itemName,
                    Expression attributeExpression)
ADVANCED: Add the expression value to be included in the result. EXAMPLE: reportQuery.addItem("name", expBuilder.get("firstName").toUpperCase());


addItem

public void addItem(java.lang.String itemName,
                    Expression attributeExpression,
                    java.util.List joinedExpressions)
ADVANCED: Add the expression value to be included in the result. EXAMPLE: reportQuery.addItem("name", expBuilder.get("firstName").toUpperCase());


addItem

protected void addItem(java.lang.String itemName,
                       Expression attributeExpression,
                       java.lang.Class resultType)
INTERNAL: Add the expression value to be included in the result. EXAMPLE: reportQuery.addItem("name", expBuilder.get("firstName").toUpperCase()); The resultType can be specified to support EJBQL that adheres to the EJB 3.0 spec.


addMaximum

public void addMaximum(java.lang.String itemName)
PUBLIC: Add the maximum value of the attribute to be included in the result. Aggregation functions can be used with a group by, or on the entire result set. EXAMPLE: reportQuery.addMaximum("salary");


addMaximum

public void addMaximum(java.lang.String itemName,
                       Expression attributeExpression)
PUBLIC: Add the maximum value of the attribute to be included in the result. Aggregation functions can be used with a group by, or on the entire result set. EXAMPLE: reportQuery.addMaximum("managerSalary", expBuilder.get("manager").get("salary"));


addMinimum

public void addMinimum(java.lang.String itemName)
PUBLIC: Add the minimum value of the attribute to be included in the result. Aggregation functions can be used with a group by, or on the entire result set. EXAMPLE: reportQuery.addMinimum("salary");


addMinimum

public void addMinimum(java.lang.String itemName,
                       Expression attributeExpression)
PUBLIC: Add the minimum value of the attribute to be included in the result. Aggregation functions can be used with a group by, or on the entire result set. EXAMPLE: reportQuery.addMinimum("managerSalary", expBuilder.get("manager").get("salary"));


addStandardDeviation

public void addStandardDeviation(java.lang.String itemName)
PUBLIC: Add the standard deviation value of the attribute to be included in the result. Aggregation functions can be used with a group by, or on the entire result set. EXAMPLE: reportQuery.addStandardDeviation("salary");


addStandardDeviation

public void addStandardDeviation(java.lang.String itemName,
                                 Expression attributeExpression)
PUBLIC: Add the standard deviation value of the attribute to be included in the result. Aggregation functions can be used with a group by, or on the entire result set. EXAMPLE: reportQuery.addStandardDeviation("managerSalary", expBuilder.get("manager").get("salary"));


addSum

public void addSum(java.lang.String itemName)
PUBLIC: Add the sum value of the attribute to be included in the result. Aggregation functions can be used with a group by, or on the entire result set. EXAMPLE: reportQuery.addSum("salary");


addSum

public void addSum(java.lang.String itemName,
                   java.lang.Class resultType)
PUBLIC: Add the sum value of the attribute to be included in the result and return it as the specified resultType. Aggregation functions can be used with a group by, or on the entire result set. EXAMPLE: reportQuery.addSum("salary", Float.class);


addSum

public void addSum(java.lang.String itemName,
                   Expression attributeExpression)
PUBLIC: Add the sum value of the attribute to be included in the result. Aggregation functions can be used with a group by, or on the entire result set. EXAMPLE: reportQuery.addSum("managerSalary", expBuilder.get("manager").get("salary"));


addSum

public void addSum(java.lang.String itemName,
                   Expression attributeExpression,
                   java.lang.Class resultType)
PUBLIC: Add the sum value of the attribute to be included in the result and return it as the specified resultType. Aggregation functions can be used with a group by, or on the entire result set. EXAMPLE: reportQuery.addSum("managerSalary", expBuilder.get("manager").get("salary"), Float.class);


addVariance

public void addVariance(java.lang.String itemName)
PUBLIC: Add the variance value of the attribute to be included in the result. Aggregation functions can be used with a group by, or on the entire result set. EXAMPLE: reportQuery.addVariance("salary");


addVariance

public void addVariance(java.lang.String itemName,
                        Expression attributeExpression)
PUBLIC: Add the variance value of the attribute to be included in the result. Aggregation functions can be used with a group by, or on the entire result set. EXAMPLE: reportQuery.addVariance("managerSalary", expBuilder.get("manager").get("salary"));


beginAddingConstructorArguments

public ConstructorReportItem beginAddingConstructorArguments(java.lang.Class constructorClass)
PUBLIC: Call a constructor for the given class with the results of this query.

Parameters:
constructorClass -

beginAddingConstructorArguments

public ConstructorReportItem beginAddingConstructorArguments(java.lang.Class constructorClass,
                                                             java.lang.Class[] constructorArgTypes)
PUBLIC: Call a constructor for the given class with the results of this query.

Parameters:
constructorClass -
constructorArgTypes - - sets the argument types to be passed to the constructor.

buildObject

public java.lang.Object buildObject(org.eclipse.persistence.internal.sessions.AbstractRecord row)
INTERNAL: By default return the row. Used by cursored stream.

Overrides:
buildObject in class ObjectLevelReadQuery

buildObject

public java.lang.Object buildObject(org.eclipse.persistence.internal.sessions.AbstractRecord row,
                                    java.util.Vector toManyJoinData)
INTERNAL: Construct a result from a row. Either return a ReportQueryResult or just the attribute.


buildObjects

public java.lang.Object buildObjects(java.util.Vector rows)
INTERNAL: Construct a container of ReportQueryResult from the rows. If only one result or value was asked for only return that.


checkEarlyReturnLocal

protected java.lang.Object checkEarlyReturnLocal(org.eclipse.persistence.internal.sessions.AbstractSession session,
                                                 org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)
INTERNAL: The cache check is done before the prepare as a hit will not require the work to be done.

Overrides:
checkEarlyReturnLocal in class ReadAllQuery

checkForCustomQuery

protected DatabaseQuery checkForCustomQuery(org.eclipse.persistence.internal.sessions.AbstractSession session,
                                            org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)
INTERNAL: Check to see if a custom query should be used for this query. This is done before the query is copied and prepared/executed. null means there is none.

Overrides:
checkForCustomQuery in class ReadAllQuery

clone

public java.lang.Object clone()
INTERNAL: Clone the query.

Overrides:
clone in class ReadAllQuery

copyReportItems

public void copyReportItems(java.util.Map alreadyDone)
INTERNAL: Required for a very special case of bug 2612185: ReportItems from parallelExpressions, on a ReportQuery which is a subQuery, which is being batch read. In a batch query the selection criteria is effectively cloned twice, meaning the ReportItems need to be cloned an extra time also to stay in sync. Each call to copiedVersionFrom() will take O(1) time as the expression was already cloned.


dontRetrievePrimaryKeys

public void dontRetrievePrimaryKeys()
PUBLIC: Set if the query results should contain the primary keys or each associated object. This make retrieving the real object easier. By default they are not retrieved.


dontReturnSingleAttribute

public void dontReturnSingleAttribute()
PUBLIC: Don't simplify the result by returning the single attribute. Wrap in a ReportQueryResult.


dontReturnSingleResult

public void dontReturnSingleResult()
PUBLIC: Simplifies the result by only returning the first result. This can be used if it known that only one row is returned by the report query.


dontReturnSingleValue

public void dontReturnSingleValue()
PUBLIC: Simplifies the result by only returning a single value. This can be used if it known that only one row is returned by the report query and only a single item is added to the report.


dontReturnWithoutReportQueryResult

public void dontReturnWithoutReportQueryResult()
PUBLIC: Simplifies the result by only returning a single value. This can be used if it known that only one row is returned by the report query and only a single item is added to the report.


endAddingToConstructorItem

public void endAddingToConstructorItem()
PUBLIC: Used in conjunction with beginAddingConstructorArguments to signal that expressions should no longer be be added to the collection used in the constructor.


executeDatabaseQuery

public java.lang.Object executeDatabaseQuery()
                                      throws DatabaseException
INTERNAL: Execute the query. Get the rows and build the objects or report data from the rows.

Overrides:
executeDatabaseQuery in class ObjectLevelReadQuery
Returns:
either collection of objects, or report data resulting from execution of query.
Throws:
DatabaseException - - an error has occurred on the database

extractRemoteResult

public java.lang.Object extractRemoteResult(org.eclipse.persistence.internal.sessions.remote.Transporter transporter)
INTERNAL: Extract the correct query result from the transporter.

Overrides:
extractRemoteResult in class ReadAllQuery

getGroupByExpressions

public java.util.List<Expression> getGroupByExpressions()
INTERNAL: Return the group bys.


hasGroupByExpressions

public boolean hasGroupByExpressions()
INTERNAL: Return if any group bys exist, allow lazy initialization. This should be called before calling getGroupByExpressions().


setGroupByExpressions

protected void setGroupByExpressions(java.util.List<Expression> groupByExpressions)
INTERNAL: Set the group bys.


getHavingExpression

public Expression getHavingExpression()
INTERNAL: Return the Having expression.


getQueryExpressions

public java.util.Vector getQueryExpressions()
INTERNAL: return a collection of expressions if PK's are used.


getDefaultRedirector

protected QueryRedirector getDefaultRedirector()
INTERNAL: Returns the specific default redirector for this query type. There are numerous default query redirectors. See ClassDescriptor for their types.

Overrides:
getDefaultRedirector in class ReadAllQuery

getItems

public java.util.List<org.eclipse.persistence.internal.queries.ReportItem> getItems()
INTERNAL:

Returns:
ReportItems defining the attributes to be read.

setItems

protected void setItems(java.util.List<org.eclipse.persistence.internal.queries.ReportItem> items)
INTERNAL: Set the ReportQueryItems defining the attributes to be read.


setLockModeType

public boolean setLockModeType(java.lang.String lockModeType,
                               org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Sets a javax.persistence.LockModeType to used with this queries execution. The valid types are: - WRITE - READ - OPTIMISTIC - OPTIMISTIC_FORCE_INCREMENT - PESSIMISTIC - PESSIMISTIC_FORCE_INCREMENT - NONE Setting a null type will do nothing.

Overrides:
setLockModeType in class ObjectLevelReadQuery
Returns:
returns a failure flag indicating that we were UNABLE to set the lock mode because of validation. Callers to this method should check the return value and throw the necessary exception.

clearItems

public void clearItems()
INTERNAL: Clear the ReportQueryItems


getNames

public java.util.List<java.lang.String> getNames()
INTERNAL: Lazily initialize and return the names of the items requested for use in each result object.


setNames

protected void setNames(java.util.List<java.lang.String> names)
INTERNAL: Set the item names.


isReportQuery

public boolean isReportQuery()
PUBLIC: Return if this is a report query.

Overrides:
isReportQuery in class DatabaseQuery

prepare

protected void prepare()
                throws QueryException
INTERNAL: Prepare the receiver for execution in a session. Initialize each item with its DTF mapping

Overrides:
prepare in class ReadAllQuery
Throws:
QueryException

prepareFetchGroup

public void prepareFetchGroup()
                       throws QueryException
INTERNAL: ReportQuery doesn't support fetch groups.

Overrides:
prepareFetchGroup in class ObjectLevelReadQuery
Throws:
QueryException

prepareFromQuery

public void prepareFromQuery(DatabaseQuery query)
INTERNAL: Prepare the query from the prepared query. This allows a dynamic query to prepare itself directly from a prepared query instance. This is used in the EJBQL parse cache to allow preparsed queries to be used to prepare dynamic queries. This only copies over properties that are configured through EJBQL.

Overrides:
prepareFromQuery in class ReadAllQuery

isDefaultPropertiesQuery

public boolean isDefaultPropertiesQuery()
INTERNAL: Return true if the query uses default properties. This is used to determine if this query is cacheable. i.e. does not use any properties that may conflict with another query with the same EJBQL or selection criteria.

Overrides:
isDefaultPropertiesQuery in class ReadAllQuery

equals

public boolean equals(java.lang.Object object)
INTERNAL: Return if the query is equal to the other. This is used to allow dynamic expression query SQL to be cached.

Overrides:
equals in class ReadAllQuery

prepareObjectAttributeCount

protected void prepareObjectAttributeCount(java.util.Map clonedExpressions)
INTERNAL: Prepare a report query with a count defined on an object attribute. Added to fix bug 3268040, addCount(objectAttribute) not supported.


prepareSelectAllRows

protected void prepareSelectAllRows()
INTERNAL: Prepare the mechanism.

Overrides:
prepareSelectAllRows in class ReadAllQuery

prepareSubSelect

public void prepareSubSelect(org.eclipse.persistence.internal.sessions.AbstractSession session,
                             org.eclipse.persistence.internal.sessions.AbstractRecord translationRow,
                             java.util.Map clonedExpressions)
                      throws QueryException
INTERNAL: Prepare the receiver for being printed inside a subselect. This prepares the statement but not the call.

Throws:
QueryException

initializeFetchGroup

public void initializeFetchGroup()
INTERNAL: Avoid processing fetch-groups for report query.


replaceValueHoldersIn

public java.util.Map replaceValueHoldersIn(java.lang.Object object,
                                           org.eclipse.persistence.internal.sessions.remote.RemoteSessionController controller)
INTERNAL: replace the value holders in the specified result object(s)

Overrides:
replaceValueHoldersIn in class ReadAllQuery

retrievePrimaryKeys

public void retrievePrimaryKeys()
PUBLIC: Set if the query results should contain the primary keys or each associated object. This make retrieving the real object easier. By default they are not retrieved.


getReturnType

public int getReturnType()
PUBLIC: Return the return type.


setReturnType

public void setReturnType(int returnChoice)
PUBLIC: Set the return type. This can be one of several constants,