Attribute Types:
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).
| Modifier and Type | Class and Description |
|---|---|
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| protected boolean | addToConstructorItem
flag to allow items to be added to the last ConstructorReportItem |
| public static final int | |
| public static final int | FULL_PRIMARY_KEY
Specifies whether to retrieve primary keys, first primary key, or no primary key. |
| protected List | groupByExpressions
Expressions representing fields to be used in the GROUP BY clause. |
| protected Expression | havingExpression
Expression representing the HAVING clause. |
| protected List | items
Items to be selected, these could be attributes or aggregate functions. |
| protected List | names
Collection of names for use by results. |
| public static final int | |
| 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 Set | |
| protected int | shouldRetrievePrimaryKeys
Flag indicating whether the primary key values should also be retrieved for the reference class. |
| public static final int | ShouldReturnArray
For EJB 3 support returns results as an Object array. |
| public static final int | ShouldReturnReportResult
Default, returns ReportQueryResult objects. |
| public static final int | ShouldReturnSingleAttribute
Simplifies the result by only returning the single attribute(as opposed to wrapping in a ReportQueryResult). |
| public static final int | ShouldReturnSingleResult
Simplifies the result by only returning the first result. |
| public static final int | ShouldReturnSingleValue
Simplifies the result by only returning one value. |
| public static final int | ShouldReturnWithoutReportQueryResult
For EJB 3 support returns results without using the ReportQueryResult |
| public static final int | ShouldSelectValue1
For example, ... |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | ReportQuery(Class<?> javaClass, ExpressionBuilder builder)
PUBLIC: The report query is require to be constructor with an expression builder. |
| public | ReportQuery(ExpressionBuilder builder)
PUBLIC: The report query is require to be constructor with an expression builder. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addAttribute(String itemName)
PUBLIC: Add the attribute from the reference class to be included in the result. |
| public void | addAttribute(String itemName, Expression attributeExpression)
PUBLIC: Add the attribute to be included in the result. |
| public void | addAttribute(String itemName, Expression attributeExpression, Class<?> type)
PUBLIC: Add the attribute to be included in the result. |
| public void | addAverage(String itemName)
PUBLIC: Add the average value of the attribute to be included in the result. |
| public 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. |
| public void | addAverage(String itemName, Expression attributeExpression)
PUBLIC: Add the average value of the attribute to be included in the result. |
| public 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. |
| public void | addConstructorReportItem(ConstructorReportItem
used to specify a class constructor and values to pass in from this query item)PUBLIC: Add a ConstructorReportItem to this query's set of return values. |
| public void | |
| public void | |
| public void | |
| public void | addCount(String itemName, Expression attributeExpression)
PUBLIC: Include the number of rows returned by the query in the result, where attributeExpression is not null. |
| public 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. |
| public void | addFunctionItem(String itemName, Expression attributeExpression, String functionName)
ADVANCED: Add the function against the attribute expression to be included in the result. |
| public void | |
| public void | |
| private void | addItem(ReportItem item)
INTERNAL: Method used to abstract addToConstructorItem behavour from the public addItem methods |
| public void | addItem(String itemName, Expression attributeExpression)
ADVANCED: Add the expression value to be included in the result. |
| public void | addItem(String itemName, Expression attributeExpression, List<E> joinedExpressions)
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. |
| public void | addMaximum(String itemName)
PUBLIC: Add the maximum value of the attribute to be included in the result. |
| public void | addMaximum(String itemName, Class<?> resultType)
PUBLIC: Add the maximum value of the attribute to be included in the result. |
| public void | addMaximum(String itemName, Expression attributeExpression)
PUBLIC: Add the maximum value of the attribute to be included in the result. |
| public void | addMaximum(String itemName, Expression attributeExpression, Class<?> resultType)
PUBLIC: Add the maximum value of the attribute to be included in the result. |
| public void | addMinimum(String itemName)
PUBLIC: Add the minimum value of the attribute to be included in the result. |
| public void | addMinimum(String itemName, Class<?> resultType)
PUBLIC: Add the minimum value of the attribute to be included in the result. |
| public void | addMinimum(String itemName, Expression attributeExpression)
PUBLIC: Add the minimum value of the attribute to be included in the result. |
| public void | addMinimum(String itemName, Expression attributeExpression, Class<?> resultType)
PUBLIC: Add the minimum value of the attribute to be included in the result. |
| public void | addStandardDeviation(String itemName)
PUBLIC: Add the standard deviation value of the attribute to be included in the result. |
| public void | addStandardDeviation(String itemName, Expression attributeExpression)
PUBLIC: Add the standard deviation value of the attribute to be included in the result. |
| public void | |
| public void | |
| public void | addSum(String itemName, Expression attributeExpression)
PUBLIC: Add the sum value of the attribute to be included in the result. |
| public 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. |
| public void | addVariance(String itemName)
PUBLIC: Add the variance value of the attribute to be included in the result. |
| public void | addVariance(String itemName, Expression attributeExpression)
PUBLIC: Add the variance value of the attribute to be included in the result. |
| public ConstructorReportItem | beginAddingConstructorArguments(Class<?> constructorClass)
PUBLIC: Call a constructor for the given class with the results of this query. |
| public ConstructorReportItem | beginAddingConstructorArguments(Class<?> constructorClass, Class<?>[]
- sets the argument types to be passed to the constructor. constructorArgTypes)PUBLIC: Call a constructor for the given class with the results of this query. |
| public Object | buildObject(AbstractRecord row)
Overrides org. |
| public Object | buildObject(AbstractRecord row, Vector<E>
All rows fetched by query. It is required to be not null. toManyJoinData)INTERNAL: Construct a result from a row. |
| public Object | |
| protected Object | checkEarlyReturnLocal(AbstractSession session, AbstractRecord translationRow)
Overrides org. |
| protected DatabaseQuery | checkForCustomQuery(AbstractSession
Current session. session, AbstractRecord Database record. translationRow)Overrides org. |
| public void | |
| public Object | |
| public void | copyReportItems(Map<K, V> 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. |
| public void | dontRetrievePrimaryKeys()
PUBLIC: Set if the query results should contain the primary keys or each associated object. |
| public void | |
| public void | |
| public void | |
| public void | |
| 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. |
| public boolean | equals(Object
the reference object with which to compare. object)Overrides org. |
| public Object | Returns: either collection of objects, or report data resulting from execution of query.Overrides org. |
| public Object | extractRemoteResult(Transporter transporter)
Overrides org. |
| protected QueryRedirector | getDefaultRedirector()
Overrides org. |
| public List | |
| public Expression | |
| public ReportItem | |
| public List | |
| public List | getNames()
INTERNAL: Lazily initialize and return the names of the items requested for use in each result object. |
| public Vector | |
| public int | |
| public boolean | |
| public boolean | isReportQuery()
Overrides org. |
| protected void | prepare()
Overrides org. |
| public void | prepareFetchGroup()
Overrides org. |
| public void | prepareFromQuery(DatabaseQuery query)
Overrides org. |
| protected void | prepareObjectAttributeCount(Map<K, V> clonedExpressions)
INTERNAL: Prepare a report query with a count defined on an object attribute. |
| private void | prepareObjectAttributeCount(List<ReportItem> items, Map<K, V> clonedExpressions)
JPQL allows count([distinct] e), where e can be an object, not just a single field, however the database only allows a single field, so object needs to be translated to a single field. |
| protected void | prepareSelectAllRows()
Overrides org. |
| public synchronized void | prepareSubSelect(AbstractSession session, AbstractRecord translationRow, Map<K, V> clonedExpressions)
INTERNAL: Prepare the receiver for being printed inside a subselect. |
| public Map | replaceValueHoldersIn(Object object, RemoteSessionController controller)
Overrides org. |
| public void | retrievePrimaryKeys()
PUBLIC: Set if the query results should contain the primary keys or each associated object. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setHavingExpression(Expression expression)
PUBLIC: Add the expression to the query to be used in the HAVING clause. |
| public void | setItems(List<ReportItem> items)
INTERNAL: Set the ReportQueryItems defining the attributes to be read. |
| public boolean | 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.Overrides org. |
| protected void | |
| public void | |
| public void | setShouldRetrieveFirstPrimaryKey(boolean shouldRetrieveFirstPrimaryKey)
ADVANCED: Sets if the query results should contain the first primary key of each associated object. |
| public void | setShouldRetrievePrimaryKeys(boolean shouldRetrievePrimaryKeys)
PUBLIC: Set if the query results should contain the primary keys or each associated object. |
| public void | setShouldReturnSingleAttribute(boolean newChoice)
PUBLIC: Simplifies the result by only returning the attribute (as opposed to wrapping in a ReportQueryResult). |
| public void | setShouldReturnSingleResult(boolean newChoice)
PUBLIC: Simplifies the result by only returning the first result. |
| public void | setShouldReturnSingleValue(boolean newChoice)
PUBLIC: Simplifies the result by only returning a single value. |
| public void | setShouldReturnWithoutReportQueryResult(boolean newChoice)
PUBLIC: Simplifies the result by returning a nested list instead of the ReportQueryResult. |
| public boolean | shouldRetrieveFirstPrimaryKey()
PUBLIC: Return if the query results should contain the first primary key of each associated object. |
| public boolean | shouldRetrievePrimaryKeys()
PUBLIC: Return if the query results should contain the primary keys or each associated object. |
| public boolean | |
| public boolean | shouldReturnSingleAttribute()
PUBLIC: Answer if we are only returning the attribute (as opposed to wrapping in a ReportQueryResult). |
| public boolean | |
| public boolean | |
| public boolean | shouldReturnWithoutReportQueryResult()
PUBLIC: Simplifies the result by returning a nested list instead of the ReportQueryResult. |
| public boolean |