use of org.eclipse.persistence.jpa.jpql.parser.IdentificationVariable in project eclipselink by eclipse-ee4j.
the class ReportItemBuilder method visit.
@Override
public void visit(ValueExpression expression) {
IdentificationVariable identificationVariable = (IdentificationVariable) expression.getExpression();
Expression queryExpression = queryContext.buildExpression(expression, type);
addAttribute(identificationVariable.getText(), queryExpression);
}
use of org.eclipse.persistence.jpa.jpql.parser.IdentificationVariable in project eclipselink by eclipse-ee4j.
the class ReportItemBuilder method visit.
@Override
public void visit(ResultVariable expression) {
// Now cache the Expression for future retrieval by the ORDER BY clause
IdentificationVariable identificationVariable = (IdentificationVariable) expression.getResultVariable();
resultVariable = identificationVariable.getText();
// Create the Expression that is added to the query as an attribute
expression.getSelectExpression().accept(this);
resultVariable = null;
}
use of org.eclipse.persistence.jpa.jpql.parser.IdentificationVariable in project eclipselink by eclipse-ee4j.
the class EclipseLinkSemanticValidatorHelper method collectLocalDeclarationIdentificationVariables.
private void collectLocalDeclarationIdentificationVariables(JPQLQueryContext queryContext, Map<String, List<IdentificationVariable>> identificationVariables) {
DeclarationResolver declarationResolver = queryContext.getDeclarationResolverImp();
// Collect the identification variables from the declarations
for (Declaration declaration : declarationResolver.getDeclarations()) {
IdentificationVariable identificationVariable = declaration.identificationVariable;
addIdentificationVariable(identificationVariable, identificationVariables);
}
// Collect the result variables
for (IdentificationVariable identificationVariable : declarationResolver.getResultVariables()) {
addIdentificationVariable(identificationVariable, identificationVariables);
}
}
use of org.eclipse.persistence.jpa.jpql.parser.IdentificationVariable in project eclipselink by eclipse-ee4j.
the class ExpressionBuilderVisitor method visit.
@Override
public void visit(ResultVariable expression) {
expression.getSelectExpression().accept(this);
IdentificationVariable identificationVariable = (IdentificationVariable) expression.getResultVariable();
String variableName = identificationVariable.getVariableName();
queryContext.addQueryExpression(variableName, queryExpression);
// Note: The type will be calculated when traversing the select expression
}
use of org.eclipse.persistence.jpa.jpql.parser.IdentificationVariable in project eclipselink by eclipse-ee4j.
the class ExpressionBuilderVisitor method visit.
@Override
public void visit(RangeVariableDeclaration expression) {
IdentificationVariable variable = (IdentificationVariable) expression.getIdentificationVariable();
Declaration declaration = queryContext.getDeclaration(variable.getVariableName());
switch(declaration.getType()) {
// that cannot be visited
case RANGE:
case CLASS_NAME:
{
type[0] = declaration.getDescriptor().getJavaClass();
queryExpression = new ExpressionBuilder(type[0]);
break;
}
// The FROM subquery needs to be created differently than a regular subquery
case SUBQUERY:
{
type[0] = null;
queryExpression = declaration.getQueryExpression();
break;
}
// This should be a derived path (CollectionValuedPathExpression) or a subquery
default:
{
expression.getRootObject().accept(this);
break;
}
}
}
Aggregations