Package org.eclipse.persistence.queries
Class ReportQuery
- All Implemented Interfaces:
Serializable
,Cloneable
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:
- addAttribute("directQueryKey") is a short cut method to add an attribute with the same name as its corresponding direct query key.
- addAttribute("attributeName", expBuilder.get("oneToOneMapping").get("directQueryKey")) is the full approach for get values through joined 1:1 relationships.
- 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).
- addAttribute("attributeName", null) Leave a place holder (NULL) value in the result (used for included values from other systems or calculated values).
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.persistence.queries.ReadAllQuery
ReadAllQuery.Direction
Nested classes/interfaces inherited from class org.eclipse.persistence.queries.DatabaseQuery
DatabaseQuery.ParameterType
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
flag to allow items to be added to the last ConstructorReportItemstatic final int
static final int
Specifies whether to retrieve primary keys, first primary key, or no primary key.protected List<Expression>
Expressions representing fields to be used in the GROUP BY clause.protected Expression
Expression representing the HAVING clause.protected List<org.eclipse.persistence.internal.queries.ReportItem>
Items to be selected, these could be attributes or aggregate functions.Collection of names for use by results.static final int
protected int
Can be one of (ShouldReturnSingleResult, ShouldReturnSingleValue, ShouldReturnSingleAttribute) Simplifies the result by only returning the first result, first value, or all attribute valuesprotected int
Flag indicating whether the primary key values should also be retrieved for the reference class.static final int
For EJB 3 support returns results as an Object array.static final int
Default, returns ReportQueryResult objects.static final int
Simplifies the result by only returning the single attribute(as opposed to wrapping in a ReportQueryResult).static final int
Simplifies the result by only returning the first result.static final int
Simplifies the result by only returning one value.static final int
For EJB 3 support returns results without using the ReportQueryResultstatic final int
For example, ...Fields inherited from class org.eclipse.persistence.queries.ReadAllQuery
connectByExpression, containerPolicy, direction, orderSiblingsByExpressions, startWithExpression
Fields inherited from class org.eclipse.persistence.queries.ObjectLevelReadQuery
additionalFields, aggregateQueries, batchFetchPolicy, cacheUsage, CheckCacheByExactPrimaryKey, CheckCacheByPrimaryKey, CheckCacheOnly, CheckCacheThenDatabase, concreteSubclassCalls, concreteSubclassJoinedMappingIndexes, concreteSubclassQueries, ConformResultsInUnitOfWork, defaultBuilder, distinctState, DoNotCheckCache, DONT_USE_DISTINCT, fetchGroup, fetchGroupName, inMemoryQueryIndirectionPolicy, isCachedExpressionQuery, isPrePrepared, isReadOnly, isReferenceClassLocked, isResultSetAccessOptimizedQuery, isResultSetAccessOptimizedQueryDefault, 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, shouldUseSerializedObjectPolicy, shouldUseSerializedObjectPolicyDefault, UNCOMPUTED_DISTINCT, unionExpressions, USE_DISTINCT, UseDescriptorSetting, usesResultSetAccessOptimization, waitTimeout, waitTimeoutUnit, WRITE
Fields inherited from class org.eclipse.persistence.queries.ObjectBuildingQuery
DEFAULT_LOCK_MODE, executionTime, isCacheCheckComplete, LOCK, LOCK_NOWAIT, LOCK_RESULT_PROPERTY, lockingClause, NO_LOCK, prefetchedCacheKeys, printInnerJoinInWhereClause, referenceClass, referenceClassName, requiresDeferredLocks, shouldBuildNullForNullPk, shouldRefreshIdentityMapResult, shouldRefreshRemoteIdentityMapResult, shouldRegisterResultsInUnitOfWork, shouldUseExclusiveConnection, wasDefaultLockMode
Fields inherited from class org.eclipse.persistence.queries.ReadQuery
allowQueryResultsCacheValidation, fetchSize, firstResult, maxResults, maxRows, queryId, queryResultCachingPolicy, temporaryCachedQueryResults
Fields inherited from class org.eclipse.persistence.queries.DatabaseQuery
accessors, allowNativeSQLQuery, argumentFields, argumentParameterTypes, arguments, argumentTypeNames, argumentTypes, argumentValues, BATCH_FETCH_PROPERTY, CascadeAggregateDelete, CascadeAllParts, CascadeByMapping, CascadeDependentParts, cascadePolicy, CascadePrivateParts, descriptor, descriptors, doNotRedirect, executionSession, flushOnExecute, hintString, isCustomQueryUsed, isExecutionClone, isNativeConnectionRequired, isPrepared, isUserDefined, isUserDefinedSQLCall, monitorName, name, NoCascading, nullableArguments, parameterDelimiter, partitioningPolicy, properties, queryMechanism, queryTimeout, queryTimeoutUnit, redirector, session, sessionName, shouldBindAllParameters, shouldCacheStatement, shouldCloneCall, shouldMaintainCache, shouldPrepare, shouldRetrieveBypassCache, shouldReturnGeneratedKeys, shouldStoreBypassCache, shouldUseWrapperPolicy, shouldValidateUpdateCallCacheUse, sourceMapping, translationRow
-
Constructor Summary
ConstructorDescriptionINTERNAL: The builder should be provided.ReportQuery
(Class javaClass, Expression expression) ReportQuery
(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
Modifier and TypeMethodDescriptionvoid
addAttribute
(String itemName) PUBLIC: Add the attribute from the reference class to be included in the result.void
addAttribute
(String itemName, Expression attributeExpression) PUBLIC: Add the attribute to be included in the result.void
addAttribute
(String itemName, Expression attributeExpression, Class type) PUBLIC: Add the attribute to be included in the result.void
addAverage
(String itemName) PUBLIC: Add the average value of the attribute to be included in the result.void
addAverage
(String itemName, 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
(String itemName, Expression attributeExpression) PUBLIC: Add the average value of the attribute to be included in the result.void
addAverage
(String itemName, Expression attributeExpression, Class resultType) PUBLIC: Add the average value of the attribute to be included in the result and return it as the specified resultType.void
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
PUBLIC: Include the number of rows returned by the query in the result, where attributeExpression is not null.void
PUBLIC: Include the number of rows returned by the query in the result, where attributeExpression is not null.void
addCount
(String itemName, Expression attributeExpression) PUBLIC: Include the number of rows returned by the query in the result, where attributeExpression is not null.void
addCount
(String itemName, Expression attributeExpression, Class resultType) PUBLIC: Include the number of rows returned by the query in the result, where attributeExpression is not null.void
addFunctionItem
(String itemName, Expression attributeExpression, String functionName) ADVANCED: Add the function against the attribute expression to be included in the result.void
addGrouping
(String attributeName) PUBLIC: Add the attribute to the group by expressions.void
addGrouping
(Expression expression) PUBLIC: Add the attribute expression to the group by expressions.void
addItem
(String itemName, Expression attributeExpression) ADVANCED: Add the expression value to be included in the result.protected void
addItem
(String itemName, Expression attributeExpression, Class resultType) INTERNAL: Add the expression value to be included in the result.void
addItem
(String itemName, Expression attributeExpression, List joinedExpressions) ADVANCED: Add the expression value to be included in the result.void
addMaximum
(String itemName) PUBLIC: Add the maximum value of the attribute to be included in the result.void
addMaximum
(String itemName, Class resultType) PUBLIC: Add the maximum value of the attribute to be included in the result.void
addMaximum
(String itemName, Expression attributeExpression) PUBLIC: Add the maximum value of the attribute to be included in the result.void
addMaximum
(String itemName, Expression attributeExpression, Class resultType) PUBLIC: Add the maximum value of the attribute to be included in the result.void
addMinimum
(String itemName) PUBLIC: Add the minimum value of the attribute to be included in the result.void
addMinimum
(String itemName, Class resultType) PUBLIC: Add the minimum value of the attribute to be included in the result.void
addMinimum
(String itemName, Expression attributeExpression) PUBLIC: Add the minimum value of the attribute to be included in the result.void
addMinimum
(String itemName, Expression attributeExpression, Class resultType) PUBLIC: Add the minimum value of the attribute to be included in the result.void
addStandardDeviation
(String itemName) PUBLIC: Add the standard deviation value of the attribute to be included in the result.void
addStandardDeviation
(String itemName, Expression attributeExpression) PUBLIC: Add the standard deviation value of the attribute to be included in the result.void
PUBLIC: Add the sum value of the attribute to be included in the result.void
PUBLIC: Add the sum value of the attribute to be included in the result and return it as the specified resultType.void
addSum
(String itemName, Expression attributeExpression) PUBLIC: Add the sum value of the attribute to be included in the result.void
addSum
(String itemName, Expression attributeExpression, 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
(String itemName) PUBLIC: Add the variance value of the attribute to be included in the result.void
addVariance
(String itemName, Expression attributeExpression) PUBLIC: Add the variance value of the attribute to be included in the result.beginAddingConstructorArguments
(Class constructorClass) PUBLIC: Call a constructor for the given class with the results of this query.beginAddingConstructorArguments
(Class constructorClass, Class[] constructorArgTypes) PUBLIC: Call a constructor for the given class with the results of this query.buildObject
(org.eclipse.persistence.internal.sessions.AbstractRecord row) INTERNAL: By default return the row.buildObject
(org.eclipse.persistence.internal.sessions.AbstractRecord row, Vector toManyJoinData) INTERNAL: Construct a result from a row.buildObjects
(Vector rows) INTERNAL: Construct a container of ReportQueryResult from the rows.protected 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
INTERNAL: Clear the ReportQueryItemsclone()
INTERNAL: Clone the query.void
copyReportItems
(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
PUBLIC: Set if the query results should contain the primary keys or each associated object.void
PUBLIC: Don't simplify the result by returning the single attribute.void
PUBLIC: Simplifies the result by only returning the first result.void
PUBLIC: Simplifies the result by only returning a single value.void
PUBLIC: Simplifies the result by only returning a single value.void
PUBLIC: Used in conjunction with beginAddingConstructorArguments to signal that expressions should no longer be be added to the collection used in the constructor.boolean
INTERNAL: Return if the query is equal to the other.INTERNAL: Execute the query.extractRemoteResult
(org.eclipse.persistence.internal.sessions.remote.Transporter transporter) INTERNAL: Extract the correct query result from the transporter.protected QueryRedirector
INTERNAL: Returns the specific default redirector for this query type.INTERNAL: Return the group bys.INTERNAL: Return the Having expression.org.eclipse.persistence.internal.queries.ReportItem
INTERNAL:List<org.eclipse.persistence.internal.queries.ReportItem>
getItems()
INTERNAL:getNames()
INTERNAL: Lazily initialize and return the names of the items requested for use in each result object.INTERNAL: return a collection of expressions if PK's are used.int
PUBLIC: Return the return type.boolean
INTERNAL: Return if any group bys exist, allow lazy initialization.boolean
PUBLIC: Return if this is a report query.protected void
prepare()
INTERNAL: Prepare the receiver for execution in a session.void
INTERNAL: ReportQuery doesn't support fetch groups.void
prepareFromQuery
(DatabaseQuery query) INTERNAL: Prepare the query from the prepared query.protected void
prepareObjectAttributeCount
(Map clonedExpressions) INTERNAL: Prepare a report query with a count defined on an object attribute.protected void
INTERNAL: Prepare the mechanism.void
prepareSubSelect
(org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, Map clonedExpressions) INTERNAL: Prepare the receiver for being printed inside a subselect.replaceValueHoldersIn
(Object object, org.eclipse.persistence.internal.sessions.remote.RemoteSessionController controller) INTERNAL: replace the value holders in the specified result object(s)void
PUBLIC: Set if the query results should contain the primary keys or each associated object.void
PUBLIC: Simplify the result by returning a single attribute.void
PUBLIC: Simplifies the result by only returning the first result.void
PUBLIC: Simplifies the result by only returning a single value.void
PUBLIC: Simplifies the result by only returning a single value.void
PUBLIC: Simplifies the result by only returning a single value.void
setGroupByExpressions
(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.void
INTERNAL: Set the ReportQueryItems defining the attributes to be read.boolean
setLockModeType
(String lockModeType, org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Sets a jakarta.persistence.LockModeType to used with this queries execution.protected void
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
PUBLIC: Return if the query results should contain the first primary key of each associated object.boolean
PUBLIC: Return if the query results should contain the primary keys or each associated object.boolean
PUBLIC: Returns true if results should be returned as an Object array.boolean
PUBLIC: Answer if we are only returning the attribute (as opposed to wrapping in a ReportQueryResult).boolean
PUBLIC: Simplifies the result by only returning the first result.boolean
PUBLIC: Simplifies the result by only returning a single value.boolean
PUBLIC: Simplifies the result by returning a nested list instead of the ReportQueryResult.boolean
PUBLIC: Returns true if results should be returned as an Object array.Methods inherited from class org.eclipse.persistence.queries.ReadAllQuery
addAscendingOrdering, cacheResult, checkCustomQueryFlag, conformResult, execute, executeObjectLevelReadQuery, executeObjectLevelReadQueryFromResultSet, getConnectByExpression, getContainerPolicy, getDirection, getOrderSiblingsByExpressions, getReadQuery, getStartWithExpression, hasHierarchicalExpressions, isDefaultPropertiesQuery, isReadAllQuery, prepareCustomQuery, prepareForExecution, registerResultInUnitOfWork, registerResultSetInUnitOfWork, remoteExecute, setContainerPolicy, setHierarchicalQueryClause, setHierarchicalQueryClause, supportsResultSetAccessOptimizationOnExecute, supportsResultSetAccessOptimizationOnPrepare, 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, addNonFetchJoin, addNonFetchJoinedAttribute, addNonFetchJoinedAttribute, addOrdering, addPartialAttribute, addPartialAttribute, addSelectionFieldsForJoinedExpression, addUnionExpression, changeDescriptor, checkCacheOnly, checkDescriptor, checkEarlyReturn, checkPrepare, checkPrePrepare, clearIsResultSetOptimizedQuery, clearUsesResultSetAccessOptimization, computeBatchReadAttributes, computeBatchReadMappingQueries, computeNestedQueriesForBatchReadExpressions, conformIndividualResult, conformResultsInUnitOfWork, copyFromQuery, deepClone, dontAcquireLocks, dontCheckCache, dontRefreshIdentityMapResult, dontRefreshRemoteIdentityMapResult, dontUseDistinct, except, executeInUnitOfWork, extendPessimisticLockScope, getAdditionalFields, getAggregateQueries, getAggregateQuery, getAsOfClause, getBatchFetchPolicy, getBatchObjects, getBatchReadAttributeExpressions, getCacheUsage, getConcreteSubclassCalls, getConcreteSubclassJoinedMappingIndexes, getConcreteSubclassQueries, getDistinctState, getExampleObject, getExecutionFetchGroup, getExecutionFetchGroup, getExpressionBuilder, getFetchGroup, getFetchGroupName, getFetchGroupNonNestedFieldsSet, getFetchGroupNonNestedFieldsSet, getFetchGroupSelectionFields, getFetchGroupSelectionFields, getInMemoryQueryIndirectionPolicy, getInMemoryQueryIndirectionPolicyState, getJoinedAttributeExpressions, getJoinedAttributeManager, getLoadGroup, getLockingClause, getLockModeType, getNonFetchJoinAttributeExpressions, getOrderByExpressions, getPartialAttributeExpressions, getPartialAttributeSelectionFields, getQueryByExamplePolicy, getReferenceClass, getReferenceClassName, getSelectionFields, getUnionExpressions, getWaitTimeout, getWaitTimeoutUnit, hasAdditionalFields, hasAsOfClause, hasBatchReadAttributes, hasDefaultBuilder, hasExecutionFetchGroup, hasFetchGroup, hashCode, hasJoining, hasNonFetchJoinedAttributeExpressions, hasOrderByExpressions, hasPartialAttributeExpressions, hasUnionExpressions, initializeDefaultBuilder, intersect, isAttributeBatchRead, isCachedExpressionQuery, isClonePessimisticLocked, isDefaultLock, isDistinctComputed, isLockQuery, isLockQuery, isObjectLevelReadQuery, isPartialAttribute, isPrePrepared, isPrimaryKeyQuery, isReadOnly, isReferenceClassLocked, isResultSetAccessOptimizedQuery, isResultSetOptimizedQuery, prepareForRemoteExecution, prepareFromCachedQuery, prepareOutsideUnitOfWork, prepareQuery, prepareResultSetAccessOptimization, prePrepare, recordCloneForPessimisticLocking, refreshIdentityMapResult, refreshRemoteIdentityMapResult, resetDistinct, setAdditionalFields, setAggregateQuery, setAsOfClause, setBatchFetchPolicy, setBatchFetchSize, setBatchFetchType, setBatchObjects, setBatchReadAttributeExpressions, setCacheUsage, setDescriptor, setDistinctState, setEJBQLString, setExampleObject, setExpressionBuilder, setFetchGroup, setFetchGroupName, setInMemoryQueryIndirectionPolicy, setInMemoryQueryIndirectionPolicyState, setIsPrepared, setIsPreparedKeepingSubclassData, setIsPrePrepared, setIsReadOnly, setIsResultSetAccessOptimizedQuery, setIsResultSetOptimizedQuery, setJoinedAttributeExpressions, setJoinedAttributeManager, setLoadGroup, setLockingClause, setLockMode, setNonFetchJoinAttributeExpressions, setOrderByExpressions, setPartialAttributeExpressions, setQueryByExamplePolicy, setReferenceClass, setReferenceClassName, setSelectionCriteria, setShouldExtendPessimisticLockScope, setShouldFilterDuplicates, setShouldIncludeData, setShouldOuterJoinSubclasses, setShouldUseDefaultFetchGroup, setShouldUseSerializedObjectPolicy, setUnionExpressions, setWaitTimeout, setWaitTimeoutUnit, shouldCheckCache, shouldCheckCacheOnly, shouldCheckDescriptorForCacheUsage, shouldConformResultsInUnitOfWork, shouldDistinctBeUsed, shouldExtendPessimisticLockScope, shouldFilterDuplicates, shouldIncludeData, shouldOuterJoinSubclasses, shouldReadAllMappings, shouldReadMapping, shouldUseDefaultFetchGroup, shouldUseSerializedObjectPolicy, toString, union, useDistinct, usesResultSetAccessOptimization
Methods inherited from class org.eclipse.persistence.queries.ObjectBuildingQuery
clonedQueryExecutionComplete, convertClassNamesToClasses, getDataResults, getExecutionTime, getLockMode, getPrefetchedCacheKeys, getQueryPrimaryKey, isAttributeJoined, isCacheCheckComplete, isObjectBuildingQuery, isRegisteringResults, postRegisterIndividualResult, printInnerJoinInWhereClause, registerIndividualResult, requiresDeferredLocks, setExecutionTime, setPrefetchedCacheKeys, setPrintInnerJoinInWhereClause, setRequiresDeferredLocks, setShouldBuildNullForNullPk, setShouldRefreshIdentityMapResult, setShouldRefreshRemoteIdentityMapResult, setShouldRegisterResultsInUnitOfWork, setShouldUseExclusiveConnection, setWasDefaultLockMode, shouldBuildNullForNullPk, shouldRefreshIdentityMapResult, shouldRefreshRemoteIdentityMapResult, shouldRegisterResultsInUnitOfWork, shouldUseExclusiveConnection, wasDefaultLockMode
Methods inherited from class org.eclipse.persistence.queries.ReadQuery
cacheQueryResults, clearQueryResults, doNotCacheQueryResults, getFetchSize, getFirstResult, getInternalMax, getMaxRows, getQueryId, getQueryResults, getQueryResults, getQueryResults, getQueryResultsCachePolicy, getTemporaryCachedQueryResults, isReadQuery, remoteExecute, setAllowQueryResultsCacheValidation, setFetchSize, setFirstResult, setInternalMax, setMaxRows, setQueryId, setQueryResults, setQueryResultsCachePolicy, setTemporaryCachedQueryResults, shouldAllowQueryResultsCacheValidation, shouldCacheQueryResults
Methods inherited from class org.eclipse.persistence.queries.DatabaseQuery
addArgument, addArgument, addArgument, addArgument, addArgument, addArgument, addArgumentByTypeName, addArgumentValue, addArgumentValues, addCall, addStatement, bindAllParameters, buildArgumentFields, buildSelectionCriteria, cacheStatement, cascadeAllParts, cascadeByMapping, cascadeOnlyDependentParts, cascadePrivateParts, checkPrepare, dontBindAllParameters, dontCacheStatement, dontCascadeParts, dontMaintainCache, getAccessor, getAccessors, getArgumentParameterTypes, getArguments, getArgumentTypeNames, getArgumentTypes, getArgumentValues, getCall, getCascadePolicy, getDatasourceCall, getDatasourceCalls, getDescriptor, getDescriptors, getDomainClassNounName, getDoNotRedirect, getEJBQLString, getExecutionSession, getFlushOnExecute, getHintString, getJPQLString, getMonitorName, getName, getNullableArguments, getParameterDelimiter, getParameterDelimiterChar, getPartitioningPolicy, getProperties, getProperty, getQueryMechanism, getQueryNounName, getQueryTimeout, getQueryTimeoutUnit, getRedirector, getRedirectorForQuery, getSelectionCriteria, getSensorName, getSession, getSessionName, getShouldBindAllParameters, getSourceMapping, getSQLStatement, getSQLString, getSQLStrings, getTranslatedSQLString, getTranslatedSQLStrings, getTranslationRow, hasAccessor, hasArguments, hasNullableArguments, hasProperties, hasQueryMechanism, hasSessionName, ignoreBindAllParameters, ignoreCacheStatement, isCallQuery, isCascadeOfAggregateDelete, isCustomQueryUsed, isCustomSelectionQuery, isDataModifyQuery, isDataReadQuery, isDeleteAllQuery, isDeleteObjectQuery, isDirectReadQuery, isExecutionClone, isExpressionQuery, isInsertObjectQuery, isJPQLCallQuery, isModifyAllQuery, isModifyQuery, isNativeConnectionRequired, isObjectLevelModifyQuery, isPrepared, isReadObjectQuery, isResultSetMappingQuery, isSQLCallQuery, isUpdateAllQuery, isUpdateObjectQuery, isUserDefined, isUserDefinedSQLCall, isValueReadQuery, isWriteObjectQuery, maintainCache, prepareCall, prepareInternal, redirectQuery, removeProperty, resetMonitorName, retrieveBypassCache, rowFromArguments, setAccessor, setAccessors, setAllowNativeSQLQuery, setArguments, setArgumentTypeNames, setArgumentTypes, setArgumentValues, setCall, setCascadePolicy, setDatasourceCall, setDoNotRedirect, setExecutionSession, setFlushOnExecute, setHintString, setIsCustomQueryUsed, setIsExecutionClone, setIsNativeConnectionRequired, setIsUserDefined, setIsUserDefinedSQLCall, setJPQLString, setName, setNullableArguments, setParameterDelimiter, setPartitioningPolicy, setProperties, setProperty, setQueryMechanism, setQueryTimeout, setQueryTimeoutUnit, setRedirector, setSession, setSessionName, setShouldBindAllParameters, setShouldBindAllParameters, setShouldCacheStatement, setShouldMaintainCache, setShouldPrepare, setShouldRetrieveBypassCache, setShouldReturnGeneratedKeys, setShouldStoreBypassCache, setShouldUseWrapperPolicy, setShouldValidateUpdateCallCacheUse, setSourceMapping, setSQLStatement, setSQLString, setTranslationRow, shouldAllowNativeSQLQuery, shouldBindAllParameters, shouldCacheStatement, shouldCascadeAllParts, shouldCascadeByMapping, shouldCascadeOnlyDependentParts, shouldCascadeParts, shouldCascadePrivateParts, shouldCloneCall, shouldIgnoreBindAllParameters, shouldIgnoreCacheStatement, shouldMaintainCache, shouldPrepare, shouldPrepare, shouldRetrieveBypassCache, shouldReturnGeneratedKeys, shouldStoreBypassCache, shouldUseWrapperPolicy, shouldValidateUpdateCallCacheUse, storeBypassCache
-
Field Details
-
ShouldReturnReportResult
public static final int ShouldReturnReportResultDefault, returns ReportQueryResult objects.- See Also:
-
ShouldReturnSingleResult
public static final int ShouldReturnSingleResultSimplifies the result by only returning the first result.- See Also:
-
ShouldReturnSingleValue
public static final int ShouldReturnSingleValueSimplifies the result by only returning one value.- See Also:
-
ShouldReturnSingleAttribute
public static final int ShouldReturnSingleAttributeSimplifies the result by only returning the single attribute(as opposed to wrapping in a ReportQueryResult).- See Also:
-
ShouldReturnWithoutReportQueryResult
public static final int ShouldReturnWithoutReportQueryResultFor EJB 3 support returns results without using the ReportQueryResult- See Also:
-
ShouldReturnArray
public static final int ShouldReturnArrayFor EJB 3 support returns results as an Object array.- See Also:
-
ShouldSelectValue1
public static final int ShouldSelectValue1For example, ... EXISTS( SELECT 1 FROM ...- See Also:
-
FULL_PRIMARY_KEY
public static final int FULL_PRIMARY_KEYSpecifies whether to retrieve primary keys, first primary key, or no primary key.- See Also:
-
FIRST_PRIMARY_KEY
public static final int FIRST_PRIMARY_KEY- See Also:
-
NO_PRIMARY_KEY
public static final int NO_PRIMARY_KEY- See Also:
-
shouldRetrievePrimaryKeys
protected int shouldRetrievePrimaryKeysFlag indicating whether the primary key values should also be retrieved for the reference class. -
names
Collection of names for use by results. -
items
Items to be selected, these could be attributes or aggregate functions. -
groupByExpressions
Expressions representing fields to be used in the GROUP BY clause. -
havingExpression
Expression representing the HAVING clause. -
returnChoice
protected int returnChoiceCan be one of (ShouldReturnSingleResult, ShouldReturnSingleValue, ShouldReturnSingleAttribute) Simplifies the result by only returning the first result, first value, or all attribute values -
addToConstructorItem
protected boolean addToConstructorItemflag to allow items to be added to the last ConstructorReportItem -
returnedKeys
-
-
Constructor Details
-
ReportQuery
public ReportQuery()INTERNAL: The builder should be provided. -
ReportQuery
-
ReportQuery
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: 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 Details
-
addAttribute
PUBLIC: Add the attribute from the reference class to be included in the result. EXAMPLE: reportQuery.addAttribute("firstName"); -
addAttribute
PUBLIC: Add the attribute to be included in the result. EXAMPLE: reportQuery.addAttribute("city", expBuilder.get("address").get("city")); -
addAttribute
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: 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: 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: 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: 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: Add a ConstructorReportItem to this query's set of return values.- Parameters:
item
- used to specify a class constructor and values to pass in from this query- See Also:
-
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
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
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
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.
objectAttributes can be specified also, even accross many to many mappings.TopLink: reportQuery.addCount("Count", getExpressionBuilder().get("address").distinct()); SQL: SELECT COUNT (DISTINCT t0.ADDR_ID) FROM EMPLOYEE t0, ...
- See Also:
-
addCount
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.
objectAttributes can be specified also, even accross many to many mappings.TopLink: reportQuery.addCount("Count", getExpressionBuilder().get("address").distinct()); SQL: SELECT COUNT (DISTINCT t0.ADDR_ID) FROM EMPLOYEE t0, ...
- See Also:
-
addFunctionItem
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: 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: 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: 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
ADVANCED: Add the expression value to be included in the result. EXAMPLE: reportQuery.addItem("name", expBuilder.get("firstName").toUpperCase()); -
addItem
ADVANCED: Add the expression value to be included in the result. EXAMPLE: reportQuery.addItem("name", expBuilder.get("firstName").toUpperCase()); -
addItem
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: 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: 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", Integer.class); -
addMaximum
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")); -
addMaximum
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"), Integer.class); -
addMinimum
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: 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", Integer.class); -
addMinimum
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")); -
addMinimum
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"), Integer.class); -
addStandardDeviation
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: 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: 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: 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: 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: 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: 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: 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: Call a constructor for the given class with the results of this query.- Parameters:
constructorClass
-
-
beginAddingConstructorArguments
public ConstructorReportItem beginAddingConstructorArguments(Class constructorClass, 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
INTERNAL: By default return the row. Used by cursored stream.- Overrides:
buildObject
in classObjectLevelReadQuery
-
buildObject
public Object buildObject(org.eclipse.persistence.internal.sessions.AbstractRecord row, Vector toManyJoinData) INTERNAL: Construct a result from a row. Either return a ReportQueryResult or just the attribute.- Parameters:
row
-toManyJoinData
- All rows fetched by query. It is required to be not null.
-
buildObjects
INTERNAL: Construct a container of ReportQueryResult from the rows. If only one result or value was asked for only return that. -
checkEarlyReturnLocal
protected 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 classReadAllQuery
-
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 classObjectLevelReadQuery
- Parameters:
session
- Current session.translationRow
- Database record.- Returns:
- Custom database query or
null
when custom database query is not set.
-
clone
INTERNAL: Clone the query.- Overrides:
clone
in classReadAllQuery
- Returns:
- A clone of this instance.
-
copyReportItems
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
INTERNAL: Execute the query. Get the rows and build the objects or report data from the rows.- Overrides:
executeDatabaseQuery
in classObjectLevelReadQuery
- Returns:
- either collection of objects, or report data resulting from execution of query.
- Throws:
DatabaseException
- - an error has occurred on the database
-
extractRemoteResult
public Object extractRemoteResult(org.eclipse.persistence.internal.sessions.remote.Transporter transporter) INTERNAL: Extract the correct query result from the transporter.- Overrides:
extractRemoteResult
in classReadAllQuery
-
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
INTERNAL: Set the group bys. -
getHavingExpression
INTERNAL: Return the Having expression. -
getQueryExpressions
INTERNAL: return a collection of expressions if PK's are used. -
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 classReadAllQuery
-
getItems
INTERNAL:- Returns:
- ReportItems defining the attributes to be read.
-
getItem
INTERNAL:- Returns:
- ReportItems with the name
-
setItems
INTERNAL: Set the ReportQueryItems defining the attributes to be read. -
setLockModeType
public boolean setLockModeType(String lockModeType, org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Sets a jakarta.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 classObjectLevelReadQuery
- 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
INTERNAL: Lazily initialize and return the names of the items requested for use in each result object. -
setNames
INTERNAL: Set the item names. -
isReportQuery
public boolean isReportQuery()PUBLIC: Return if this is a report query.- Overrides:
isReportQuery
in classDatabaseQuery
-
prepare
INTERNAL: Prepare the receiver for execution in a session. Initialize each item with its DTF mapping- Overrides:
prepare
in classReadAllQuery
- Throws:
QueryException
-
prepareFetchGroup
INTERNAL: ReportQuery doesn't support fetch groups.- Overrides:
prepareFetchGroup
in classObjectLevelReadQuery
- Throws:
QueryException
-
prepareFromQuery
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 classReadAllQuery
-
equals
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 classReadAllQuery
-
prepareObjectAttributeCount
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 classReadAllQuery
-
prepareSubSelect
public void prepareSubSelect(org.eclipse.persistence.internal.sessions.AbstractSession session, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, Map clonedExpressions) throws QueryException INTERNAL: Prepare the receiver for being printed inside a subselect. This prepares the statement but not the call.- Throws:
QueryException
-
replaceValueHoldersIn
public Map replaceValueHoldersIn(Object object, org.eclipse.persistence.internal.sessions.remote.RemoteSessionController controller) INTERNAL: replace the value holders in the specified result object(s)- Overrides:
replaceValueHoldersIn
in classReadAllQuery
-
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,- ShouldReturnReportResult - return List<ReportQueryResult> : ReportQueryResult (Map) of each row is returned.
- ShouldReturnSingleResult - return ReportQueryResult : Only first row is returned.
- ShouldReturnSingleAttribute - return List<Object> : Only first column of (all) rows are returned.
- ShouldReturnSingleValue - return Object : Only first value of first row is returned.
- ShouldReturnWithoutReportQueryResult - return List<Object[]> : Array of each row is returned.
-
returnSingleAttribute
public void returnSingleAttribute()PUBLIC: Simplify the result by returning a single attribute. Don't wrap in a ReportQueryResult. -
returnSingleResult
public void returnSingleResult()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. -
returnSingleValue
public void returnSingleValue()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. -
returnWithoutReportQueryResult
public void returnWithoutReportQueryResult()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. -
selectValue1
public void selectValue1()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. -
setShouldRetrievePrimaryKeys
public void setShouldRetrievePrimaryKeys(boolean shouldRetrievePrimaryKeys) 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. -
setShouldRetrieveFirstPrimaryKey
public void setShouldRetrieveFirstPrimaryKey(boolean shouldRetrieveFirstPrimaryKey) ADVANCED: Sets if the query results should contain the first primary key of each associated object. Usefull if this is an EXISTS subquery and you don't care what fields are returned so long as it is a single field. The default value is false. This should only be used with a subquery. -
setShouldReturnSingleAttribute
public void setShouldReturnSingleAttribute(boolean newChoice) PUBLIC: Simplifies the result by only returning the attribute (as opposed to wrapping in a ReportQueryResult). This can be used if it is known that only one attribute is returned by the report query. -
setShouldReturnSingleResult
public void setShouldReturnSingleResult(boolean newChoice) 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. -
setShouldReturnSingleValue
public void setShouldReturnSingleValue(boolean newChoice) 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. -
setShouldReturnWithoutReportQueryResult
public void setShouldReturnWithoutReportQueryResult(boolean newChoice) PUBLIC: Simplifies the result by returning a nested list instead of the ReportQueryResult. This is used by EJB 3. -
shouldRetrievePrimaryKeys
public boolean shouldRetrievePrimaryKeys()PUBLIC: Return if the query results should contain the primary keys or each associated object. This make retrieving the real object easier. -
shouldRetrieveFirstPrimaryKey
public boolean shouldRetrieveFirstPrimaryKey()PUBLIC: Return if the query results should contain the first primary key of each associated object. Usefull if this is an EXISTS subquery and you don't care what fields are returned so long as it is a single field. -
shouldReturnSingleAttribute
public boolean shouldReturnSingleAttribute()PUBLIC: Answer if we are only returning the attribute (as opposed to wrapping in a ReportQueryResult). This can be used if it is known that only one attribute is returned by the report query. -
shouldReturnSingleResult
public boolean shouldReturnSingleResult()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. -
shouldReturnSingleValue
public boolean shouldReturnSingleValue()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. -
shouldReturnWithoutReportQueryResult
public boolean shouldReturnWithoutReportQueryResult()PUBLIC: Simplifies the result by returning a nested list instead of the ReportQueryResult. This is used by EJB 3. -
shouldReturnArray
public boolean shouldReturnArray()PUBLIC: Returns true if results should be returned as an Object array. -
shouldSelectValue1
public boolean shouldSelectValue1()PUBLIC: Returns true if results should be returned as an Object array.
-