Class HierarchicalQueryClause

  • All Implemented Interfaces:
    Expression

    public final class HierarchicalQueryClause
    extends AbstractExpression
    If a table contains hierarchical data, then rows can be selected in a hierarchical order using the hierarchical query clause.

    START WITH specifies the root row(s) of the hierarchy.

    CONNECT BY specifies the relationship between parent rows and child rows of the hierarchy.

    BNF: hierarchical_query_clause ::= [start_with_clause] connectby_clause [order_siblings_by_clause]

    Since:
    2.5
    Version:
    2.5
    Author:
    Pascal Filion
    See Also:
    StartWithClause, ConnectByClause, OrderSiblingsByClause
    • Constructor Detail

      • HierarchicalQueryClause

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

      • getConnectByClause

        public Expression getConnectByClause()
        Returns the Expression representing the CONNECT BY clause.
        Returns:
        The expression representing the CONNECT BY clause
      • getOrderSiblingsByClause

        public Expression getOrderSiblingsByClause()
        Returns the Expression representing the ORDER SIBLINGS BY clause.
        Returns:
        The expression representing the ORDER SIBLINGS BY clause
      • getStartWithClause

        public Expression getStartWithClause()
        Returns the Expression representing the START WITH clause.
        Returns:
        The expression representing the START WITH clause
      • hasConnectByClause

        public boolean hasConnectByClause()
        Determines whether the CONNECT BY clause is defined.
        Returns:
        true if the query that got parsed had the CONNECT BY clause
      • hasOrderSiblingsByClause

        public boolean hasOrderSiblingsByClause()
        Determines whether the ORDER SIBLINGS BY clause is defined.
        Returns:
        true if the query that got parsed had the ORDER SIBLINGS BY clause
      • hasSpaceAfterConnectByClause

        public boolean hasSpaceAfterConnectByClause()
        Determines whether a whitespace was found after the CONNECT BY clause. In some cases, the space is owned by a child of the hierarchical query clause.
        Returns:
        true if there was a whitespace after the CONNECT BY clause and owned by this expression; false otherwise
      • hasSpaceAfterStartWithClause

        public boolean hasSpaceAfterStartWithClause()
        Determines whether a whitespace was found after the START WITH clause. In some cases, the space is owned by a child of the hierarchical query clause.
        Returns:
        true if there was a whitespace after the START WITH clause and owned by this expression; false otherwise
      • hasStartWithClause

        public boolean hasStartWithClause()
        Determines whether the START WITH clause is defined.
        Returns:
        true if the query that got parsed had the START WITH clause