Modify a query based on the contents
The SELECT statement determines the return type of an EJBQL query.
The SELECT may also determine the distinct state of a query
A SELECT can be one of the following:
1. SELECT OBJECT(someObject)... This query will return a collection of objects
2. SELECT anObject.anAttribute ... This will return a collection of anAttribute
3. SELECT <aggregateFunction> ... This will return a single value
The allowable aggregateFunctions are: AVG, COUNT, MAX, MIN, SUM
SELECT AVG(emp.salary)... Returns the average of all the employees salaries
SELECT COUNT(emp)... Returns a count of the employees
SELECT COUNT(emp.firstName)... Returns a count of the employee's firstNames
SELECT MAX(emp.salary)... Returns the maximum employee salary
SELECT MIN(emp.salary)... Returns the minimum employee salary
SELECT SUM(emp.salary)... Returns the sum of all the employees salaries
qualifyAttributeAccess(ParseTreeContext context) INTERNAL
Check the select expression nodes for a path expression starting with a
unqualified field access and if so, replace it by a qualified field
access.
INTERNAL
Returns a DatabaseQuery instance representing the owning
ParseTree. This implementation returns a ReadAllQuery for simple SELECT
queries and a ReportQuery otherwise.
public boolean isSelected(String variableName)(Code)
Answer true if the variable name given as argument is SELECTed.
True: "SELECT OBJECT(emp) ...." & variableName = "emp"
False: "SELECT OBJECT(somethingElse) ..." & variableName = "emp"
INTERNAL
Check the select expression nodes for a path expression starting with a
unqualified field access and if so, replace it by a qualified field
access.
Verify that the selected alias is a valid alias. If it's not valid,
an Exception will be thrown, likely EJBQLException.aliasResolutionException.
Valid: SELECT OBJECT(emp) FROM Employee emp WHERE ...
Invalid: SELECT OBJECT(badAlias) FROM Employee emp WHERE ...
Methods inherited from oracle.toplink.essentials.internal.parsing.QueryNode