}
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);
}
}
}