/** * Returns the {@link DeclarationResolver} of the current query's declaration. For a * <b>SELECT</b> query, it contains the information defined in the <b>FROM</b> clause. For * <b>DELETE</b> and <b>UPDATE</b> queries, it contains a single range declaration variable. If * the current query is a subquery, then it contains the information defined in the * <code>FROM</code> clause. * * @return The {@link DeclarationResolver} for the current query being visited */ DeclarationResolver getDeclarationResolver() { return currentContext.getDeclarationResolverImp(); }
/** * Returns the {@link DeclarationResolver} of the current query's declaration. For a * <b>SELECT</b> query, it contains the information defined in the <b>FROM</b> clause. For * <b>DELETE</b> and <b>UPDATE</b> queries, it contains a single range declaration variable. If * the current query is a subquery, then it contains the information defined in the * <code>FROM</code> clause. * * @return The {@link DeclarationResolver} for the current query being visited */ DeclarationResolver getDeclarationResolver() { return currentContext.getDeclarationResolverImp(); }
/** * Determines whether the given variable name is an identification variable name used to define * an abstract schema name. * * @param variableName The name of the variable to verify if it's defined in a range variable * declaration in the current query or any parent query * @return <code>true</code> if the variable name is mapping an abstract schema name; <code>false</code> * if it's defined in a collection member declaration */ boolean isRangeIdentificationVariable(String variableName) { return getDeclarationResolverImp().isRangeIdentificationVariable(variableName); }
/** * Determines whether the given variable name is an identification variable name used to define * an abstract schema name. * * @param variableName The name of the variable to verify if it's defined in a range variable * declaration in the current query or any parent query * @return <code>true</code> if the variable name is mapping an abstract schema name; <code>false</code> * if it's defined in a collection member declaration */ boolean isRangeIdentificationVariable(String variableName) { return getDeclarationResolverImp().isRangeIdentificationVariable(variableName); }
/** * Returns the first {@link Declaration}, from this context, that was created after visiting the * declaration clause. * * @return The first {@link Declaration} object */ Declaration getFirstDeclarationImp() { return getDeclarationResolverImp().getFirstDeclaration(); }
/** * Returns the first {@link Declaration}, from this context, that was created after visiting the * declaration clause. * * @return The first {@link Declaration} object */ Declaration getFirstDeclarationImp() { return getDeclarationResolverImp().getFirstDeclaration(); }
/** * Determines if the given variable is a result variable. * * @param variableName The variable to check if it's a result variable * @return <code>true</code> if the given variable is defined as a result variable; * <code>false</code> otherwise */ boolean isResultVariable(String variableName) { return getDeclarationResolverImp().isResultVariable(variableName); }
/** * Determines if the given variable is a result variable. * * @param variableName The variable to check if it's a result variable * @return <code>true</code> if the given variable is defined as a result variable; * <code>false</code> otherwise */ boolean isResultVariable(String variableName) { return getDeclarationResolverImp().isResultVariable(variableName); }
Declaration findDeclarationImp(String variableName) { Declaration declaration = getDeclarationResolverImp().getDeclaration(variableName); if ((declaration == null) && (parent != null)) { declaration = parent.findDeclarationImp(variableName); } return declaration; }
/** * Returns the {@link DeclarationResolver} of the current query's declaration. * * @return The {@link DeclarationResolver} for the current query being visited */ DeclarationResolver getDeclarationResolverImp() { if (declarationResolver == null) { DeclarationResolver parentResolver = (parent == null) ? null : parent.getDeclarationResolverImp(); declarationResolver = new DeclarationResolver(this, parentResolver); } declarationResolver.populate(currentQuery); return declarationResolver; }
/** * Returns the {@link DeclarationResolver} of the current query's declaration. * * @return The {@link DeclarationResolver} for the current query being visited */ DeclarationResolver getDeclarationResolverImp() { if (declarationResolver == null) { DeclarationResolver parentResolver = (parent == null) ? null : parent.getDeclarationResolverImp(); declarationResolver = new DeclarationResolver(this, parentResolver); } declarationResolver.populate(currentQuery); return declarationResolver; }
/** * {@inheritDoc} */ @Override public List<JPQLQueryDeclaration> getAllDeclarations() { List<JPQLQueryDeclaration> declarations = new ArrayList<JPQLQueryDeclaration>(); JPQLQueryContext context = queryContext.getCurrentContext(); while (context != null) { declarations.addAll(context.getDeclarationResolverImp().getDeclarations()); context = context.getActualParent(); } return declarations; }
Declaration findDeclarationImp(String variableName) { Declaration declaration = getDeclarationResolverImp().getDeclaration(variableName); if ((declaration == null) && (parent != null)) { declaration = parent.findDeclarationImp(variableName); } return declaration; }
/** * {@inheritDoc} */ @Override public List<JPQLQueryDeclaration> getAllDeclarations() { List<JPQLQueryDeclaration> declarations = new ArrayList<JPQLQueryDeclaration>(); JPQLQueryContext context = queryContext.getCurrentContext(); while (context != null) { declarations.addAll(context.getDeclarationResolverImp().getDeclarations()); context = context.getActualParent(); } return declarations; }
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); } }
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); } }