Class ConnectByClause

  • All Implemented Interfaces:
    Expression

    public final class ConnectByClause
    extends AbstractExpression
    The CONNECT BY clause allows selecting rows in a hierarchical order using the hierarchical query clause. CONNECT BY specifies the relationship between parent rows and child rows of the hierarchy.
    BNF: connectby_clause ::= CONNECT BY { single_valued_object_path_expression | collection_valued_path_expression }

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

      • ConnectByClause

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

      • getActualIdentifier

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

        public Expression getExpression()
        Returns the Expression representing the relationship expression.
        Returns:
        The expression representing the relationship expression
      • hasExpression

        public boolean hasExpression()
        Determines whether the relationship expression was parsed.
        Returns:
        true if the relationship expression was parsed; false if it was not parsed
      • hasSpaceAfterConnectBy

        public boolean hasSpaceAfterConnectBy()
        Determines whether a whitespace was found after CONNECT BY.
        Returns:
        true if there was a whitespace after CONNECT BY; 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.
        Specified by:
        parse in class AbstractExpression
        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
      • toParsedText

        protected void toParsedText​(java.lang.StringBuilder writer,
                                    boolean actual)
        Generates a string representation of this Expression, including its children, if it has any.
        Specified by:
        toParsedText in class AbstractExpression
        Parameters:
        writer - The buffer used to append this Expression's string representation
        actual - Determines whether the string representation should represent what was parsed, i.e. include any "virtual" whitespace (such as ending whitespace) and the actual case of the JPQL identifiers