Class ExistsExpression

  • All Implemented Interfaces:
    Expression

    public final class ExistsExpression
    extends AbstractSingleEncapsulatedExpression
    An EXISTS expression is a predicate that is true only if the result of the subquery consists of one or more values and that is false otherwise.
    BNF: exists_expression ::= [NOT] EXISTS(subquery)

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

      • ExistsExpression

        public ExistsExpression​(AbstractExpression parent)
        Creates a new ExistsExpression.
        Parameters:
        parent - The parent of this expression
    • Method Detail

      • getActualNotIdentifier

        public java.lang.String getActualNotIdentifier()
        Returns the actual NOT identifier found in the string representation of the JPQL query, which has the actual case that was used.
        Returns:
        The NOT identifier that was actually parsed, or an empty string if it was not parsed
      • hasNot

        public boolean hasNot()
        Determines whether the identifier NOT was parsed.
        Returns:
        true if the identifier NOT was parsed; false otherwise
      • parse

        protected void parse​(WordParser wordParser,
                             boolean tolerant)
        Parses the query by starting at the current position, which is part of the given WordParser.
        Overrides:
        parse in class AbstractEncapsulatedExpression
        Parameters:
        wordParser - The text to parse based on the current position of the cursor
        tolerant - Determines whether the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries
      • 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