Class AllOrAnyExpression

  • All Implemented Interfaces:
    Expression

    public final class AllOrAnyExpression
    extends AbstractSingleEncapsulatedExpression
    An ALL conditional expression is a predicate that is true if the comparison operation is true for all values in the result of the subquery or the result of the subquery is empty. An ALL conditional expression is false if the result of the comparison is false for at least one row, and is unknown if neither true nor false.

    An ANY conditional expression is a predicate that is true if the comparison operation is true for some value in the result of the subquery. An ANY conditional expression is false if the result of the subquery is empty or if the comparison operation is false for every value in the result of the subquery, and is unknown if neither true nor false. The keyword SOME is synonymous with ANY. The comparison operators used with ALL or ANY conditional expressions are =, <, <=, >, >=, <>. The result of the subquery must be like that of the other argument to the comparison operator in type.

    BNF: all_or_any_expression ::= {ALL|ANY|SOME}(subquery)

    Version:
    2.5
    Author:
    Pascal Filion
    Since:
    2.3
    • Constructor Detail

      • AllOrAnyExpression

        public AllOrAnyExpression​(AbstractExpression parent,
                                  java.lang.String identifier)
        Creates a new AllOrAnyExpression.
        Parameters:
        parent - The parent of this expression
        identifier - Either ALL, ANY or SOME
    • Method Detail

      • parse

        protected AbstractExpression parse​(WordParser wordParser,
                                           java.lang.String queryBNFId,
                                           boolean tolerant)
        Parses the given text by using the specified BNF.
        Overrides:
        parse in class AbstractExpression
        Parameters:
        wordParser - The text to parse based on the current position of the cursor
        queryBNFId - The unique identifier of the JPQLQueryBNF that is used to determine how to parse the text at the current cursor position within the JPQL query
        tolerant - Determines whether the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries
        Returns:
        The Expression representing the given sub-query