/** * Returns the parsed representation of a <b>JOIN FETCH</b> that were defined in the same * declaration than the given range identification variable name. * * @param variableName The name of the identification variable that should be used to define an * abstract schema name * @return The <b>JOIN FETCH</b> expressions used in the same declaration or an empty collection * if none was defined */ Collection<Join> getJoinFetches(String variableName) { return getDeclarationResolver().getJoinFetches(variableName); }
/** * Determines whether the given identification variable is defining a join or a collection member * declaration expressions. * * @param variableName The identification variable to check for what it maps * @return <code>true</code> if the given identification variable maps a collection-valued field * defined in a <code>JOIN</code> or <code>IN</code> expression; <code>false</code> if it's not * defined or it's mapping an abstract schema name */ boolean isCollectionIdentificationVariable(String variableName) { return getDeclarationResolver().isCollectionIdentificationVariable(variableName); }
/** * Returns the ordered list of {@link Declaration Declarations}. * * @return The {@link Declaration Declarations} of the current query that was parsed */ List<Declaration> getDeclarations() { return getDeclarationResolver().getDeclarations(); }
/** * Retrieves the {@link Declaration} for which the given variable name is used to navigate to the * "root" object. This does not go up the hierarchy when looking for the {@link Declaration}. * * @param variableName The name of the identification variable that is used to navigate a "root" object * @return The {@link Declaration} containing the information about the identification variable declaration * @see #findDeclaration(String) */ Declaration getDeclaration(String variableName) { return getDeclarationResolver().getDeclaration(variableName); }
/** * Determines whether the given identification variable is defining a join or a collection member * declaration expressions. * * @param variableName The identification variable to check for what it maps * @return <code>true</code> if the given identification variable maps a collection-valued field * defined in a <code>JOIN</code> or <code>IN</code> expression; <code>false</code> if it's not * defined or it's mapping an abstract schema name */ boolean isCollectionIdentificationVariable(String variableName) { return getDeclarationResolver().isCollectionIdentificationVariable(variableName); }
/** * Retrieves the {@link Declaration} for which the given variable name is used to navigate to the * "root" object. This does not go up the hierarchy when looking for the {@link Declaration}. * * @param variableName The name of the identification variable that is used to navigate a "root" object * @return The {@link Declaration} containing the information about the identification variable declaration * @see #findDeclaration(String) */ Declaration getDeclaration(String variableName) { return getDeclarationResolver().getDeclaration(variableName); }
/** * Returns the parsed representation of a <b>JOIN FETCH</b> that were defined in the same * declaration than the given range identification variable name. * * @param variableName The name of the identification variable that should be used to define an * abstract schema name * @return The <b>JOIN FETCH</b> expressions used in the same declaration or an empty collection * if none was defined */ Collection<Join> getJoinFetches(String variableName) { return getDeclarationResolver().getJoinFetches(variableName); }
/** * Returns the ordered list of {@link Declaration Declarations}. * * @return The {@link Declaration Declarations} of the current query that was parsed */ List<Declaration> getDeclarations() { return getDeclarationResolver().getDeclarations(); }
/** * Returns the root {@link Expression} for which all new {@link Expression expressions} a child. * * @return The root {@link Expression} of the query or subquery */ Expression getBaseExpression() { // Retrieve the first declaration, which is the base declaration (For top-level query, it's // always a range over an abstract schema name. For subqueries, it's either a range over an // abstract schema name or a derived path expression) return getDeclarationResolver().getFirstDeclaration().getQueryExpression(); }
/** * Returns the root {@link Expression} for which all new {@link Expression expressions} a child. * * @return The root {@link Expression} of the query or subquery */ Expression getBaseExpression() { // Retrieve the first declaration, which is the base declaration (For top-level query, it's // always a range over an abstract schema name. For subqueries, it's either a range over an // abstract schema name or a derived path expression) return getDeclarationResolver().getFirstDeclaration().getQueryExpression(); }
/** * Converts the given {@link Declaration} from being set as a range variable declaration to * a path expression declaration. * <p> * In this query "<code>UPDATE Employee SET firstName = 'MODIFIED' WHERE (SELECT COUNT(m) FROM * managedEmployees m) > 0</code>" <em>managedEmployees</em> is an unqualified collection-valued * path expression (<code>employee.managedEmployees</code>). */ private void convertUnqualifiedDeclaration() { // Retrieve the range identification variable from the parent declaration Declaration parentDeclaration = queryContext.getParent().getFirstDeclarationImp(); String outerVariableName = parentDeclaration.getVariableName(); // Qualify the range expression to be fully qualified queryContext.getDeclarationResolver().convertUnqualifiedDeclaration(this, outerVariableName); }
/** * Converts the given {@link Declaration} from being set as a range variable declaration to * a path expression declaration. * <p> * In this query "<code>UPDATE Employee SET firstName = 'MODIFIED' WHERE (SELECT COUNT(m) FROM * managedEmployees m) > 0</code>" <em>managedEmployees</em> is an unqualified collection-valued * path expression (<code>employee.managedEmployees</code>). */ private void convertUnqualifiedDeclaration() { // Retrieve the range identification variable from the parent declaration Declaration parentDeclaration = queryContext.getParent().getFirstDeclarationImp(); String outerVariableName = parentDeclaration.getVariableName(); // Qualify the range expression to be fully qualified queryContext.getDeclarationResolver().convertUnqualifiedDeclaration(this, outerVariableName); }