Search in sources :

Example 1 with DeclarationResolver

use of org.eclipse.persistence.jpa.jpql.tools.resolver.DeclarationResolver in project eclipselink by eclipse-ee4j.

the class GenericSemanticValidatorHelper method collectLocalDeclarationIdentificationVariables.

protected void collectLocalDeclarationIdentificationVariables(JPQLQueryContext queryContext, Map<String, List<IdentificationVariable>> identificationVariables) {
    DeclarationResolver declarationResolver = queryContext.getDeclarationResolverImp();
    for (Declaration declaration : declarationResolver.getDeclarations()) {
        // Register the identification variable from the base expression
        IdentificationVariable identificationVariable = declaration.getIdentificationVariable();
        addIdentificationVariable(identificationVariable, identificationVariables);
        // Register the identification variable from the JOIN expressions
        for (Join join : declaration.getJoins()) {
            IdentificationVariable joinIdentificationVariable = getIdentificationVariable(join.getIdentificationVariable());
            addIdentificationVariable(joinIdentificationVariable, identificationVariables);
        }
    }
    if (queryContext.getParent() == null) {
        for (IdentificationVariable identificationVariable : declarationResolver.getResultVariablesMap().keySet()) {
            addIdentificationVariable(identificationVariable, identificationVariables);
        }
    }
}
Also used : IdentificationVariable(org.eclipse.persistence.jpa.jpql.parser.IdentificationVariable) DeclarationResolver(org.eclipse.persistence.jpa.jpql.tools.resolver.DeclarationResolver) Join(org.eclipse.persistence.jpa.jpql.parser.Join) JPQLQueryDeclaration(org.eclipse.persistence.jpa.jpql.JPQLQueryDeclaration) ITypeDeclaration(org.eclipse.persistence.jpa.jpql.tools.spi.ITypeDeclaration) Declaration(org.eclipse.persistence.jpa.jpql.tools.resolver.Declaration)

Aggregations

JPQLQueryDeclaration (org.eclipse.persistence.jpa.jpql.JPQLQueryDeclaration)1 IdentificationVariable (org.eclipse.persistence.jpa.jpql.parser.IdentificationVariable)1 Join (org.eclipse.persistence.jpa.jpql.parser.Join)1 Declaration (org.eclipse.persistence.jpa.jpql.tools.resolver.Declaration)1 DeclarationResolver (org.eclipse.persistence.jpa.jpql.tools.resolver.DeclarationResolver)1 ITypeDeclaration (org.eclipse.persistence.jpa.jpql.tools.spi.ITypeDeclaration)1