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)
Since:
2.3
Version:
2.5
  • Constructor Details

    • ExistsExpression

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

    • accept

      public void accept(ExpressionVisitor visitor)
      Description copied from interface: Expression
      Visits this Expression by the given visitor.
      Parameters:
      visitor - The ExpressionVisitor to visit this object
    • getEncapsulatedExpressionQueryBNFId

      public String getEncapsulatedExpressionQueryBNFId()
      Description copied from class: AbstractSingleEncapsulatedExpression
      Returns the BNF used to parse the encapsulated expression.
      Specified by:
      getEncapsulatedExpressionQueryBNFId in class AbstractSingleEncapsulatedExpression
      Returns:
      The BNF used to parse the encapsulated expression
    • getActualNotIdentifier

      public 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
    • getQueryBNF

      public JPQLQueryBNF getQueryBNF()
      Description copied from interface: Expression
      Returns the BNF of this Expression.
      Returns:
      The JPQLQueryBNF, which represents the grammar of this Expression
    • 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)
      Description copied from class: AbstractExpression
      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, String queryBNFId, boolean tolerant)
      Description copied from class: AbstractExpression
      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