Class SelectStatement

  • All Implemented Interfaces:
    Expression

    public final class SelectStatement
    extends AbstractSelectStatement
    A SELECT query is an operation that retrieves data from one or more tables or views.

    JPA:

    BNF: select_statement ::= select_clause from_clause [where_clause] [groupby_clause] [having_clause] [orderby_clause]

    EclipseLink 2.4:

    BNF: select_statement ::= select_clause from_clause [where_clause] [groupby_clause] [having_clause] [orderby_clause] {union_clause}*

    HQL query (EclipseLink 2.5):

    BNF: select_statement ::= [select_clause] from_clause [where_clause] [groupby_clause] [having_clause] [orderby_clause] {union_clause}*

    Since:
    2.3
    Version:
    2.5
    Author:
    Pascal Filion
    See Also:
    FromClause, GroupByClause, HavingClause, HierarchicalQueryClause, OrderByClause, SelectClause, UnionClause, WhereClause
    • Constructor Detail

      • SelectStatement

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

      • getOrderByClause

        public Expression getOrderByClause()
        Returns the Expression representing the ORDER BY clause.
        Returns:
        The expression representing the ORDER BY clause
      • getUnionClauses

        public Expression getUnionClauses()
        Returns the Expression representing the UNION clauses.
        Returns:
        The Expression representing the UNION clauses
      • hasOrderByClause

        public boolean hasOrderByClause()
        Determines whether the ORDER BY clause is defined or not.
        Returns:
        true if the query that got parsed had the ORDER BY clause
      • hasSpaceBeforeOrderBy

        public boolean hasSpaceBeforeOrderBy()
        Determines whether a whitespace was parsed before the ORDER BY clause. In some cases, the space could be owned by a child of the previous clause.
        Returns:
        true if there was a whitespace before the ORDER BY; false otherwise
      • hasSpaceBeforeUnion

        public boolean hasSpaceBeforeUnion()
        Determines whether a whitespace was parsed before the UNION clause. In some cases, the space could be owned by a child of the previous clause.
        Returns:
        true if there was a whitespace before the UNION; false otherwise
      • hasUnionClauses

        public boolean hasUnionClauses()
        Determines whether at least one UNION clause was defined.
        Returns:
        true if the query that got parsed had the UNION clauses