Class SqlGroupByClauseTerminal<ReturnType>

All Implemented Interfaces:
GroupByClauseTerminal<ReturnType,SqlHavingConditionClause<ReturnType>,SqlHavingConditionClauseTerminal<ReturnType>,SqlQueryConditionBuilder<ReturnType>,SqlOrderByClause<ReturnType>,SqlOrderByClauseChain<ReturnType>>, HavingClauseTerminal<ReturnType,SqlOrderByClause<ReturnType>,SqlOrderByClauseChain<ReturnType>>, LimitClauseTerminal<ReturnType>, OrderByClauseTerminal<ReturnType>, SelectTerminal<ReturnType>

public final class SqlGroupByClauseTerminal<ReturnType> extends AbstractGroupByClauseTerminal<ReturnType,SqlHavingConditionClause<ReturnType>,SqlHavingConditionClauseTerminal<ReturnType>,SqlQueryConditionBuilder<ReturnType>,SqlOrderByClause<ReturnType>,SqlOrderByClauseChain<ReturnType>>
SQL-mode terminal clause for GROUP BY clauses.
  • Constructor Details

    • SqlGroupByClauseTerminal

      public SqlGroupByClauseTerminal(SelectNode selectNode, ExpressionSpec[] expressions, QueryNode node, SelectEngineTerminal selectEngineTerminal, LitebridgeContext litebridgeContext)
      Creates a new SqlGroupByClauseTerminal instance using expressions.
      Parameters:
      selectNode - the root select query node
      expressions - the group-by expressions
      node - the current query node
      selectEngineTerminal - the terminal select engine
      litebridgeContext - the Litebridge context
    • SqlGroupByClauseTerminal

      public SqlGroupByClauseTerminal(SelectNode selectNode, String[] columns, QueryNode node, SelectEngineTerminal selectEngineTerminal, LitebridgeContext litebridgeContext)
      Creates a new SqlGroupByClauseTerminal instance using column names.
      Parameters:
      selectNode - the root select query node
      columns - the group-by column names
      node - the current query node
      selectEngineTerminal - the terminal select engine
      litebridgeContext - the Litebridge context
  • Method Details

    • having

      public SqlHavingConditionClause<ReturnType> having(ExpressionSpec expression)
      Description copied from interface: GroupByClauseTerminal
      Starts a HAVING clause for the SQL query.
      Parameters:
      expression - the expression to apply the filtering condition on
      Returns:
      an instance of HCC representing the next stage of the having condition clause
    • orderBy

      public SqlOrderByClause<ReturnType> orderBy(String... columns)
      Description copied from interface: HavingClauseTerminal
      Adds an ORDER BY clause to the query, specifying the expressions to sort the results by.
      Parameters:
      columns - the expressions that determine the order of the results. Each column must be valid for the associated table or view in the query. The order in which the expressions are specified determines the priority of ordering.
      Returns:
      an instance of the type representing the ORDER BY clause, allowing further specification of ordering or transitioning to the next query stage.
    • orderBy

      public SqlOrderByClause<ReturnType> orderBy(ExpressionSpec... expressions)
      Description copied from interface: HavingClauseTerminal
      Adds an ORDER BY clause to the query, specifying the fields and expressions to sort the results by.
      Parameters:
      expressions - the expressions that determine the order of the results.
      Returns:
      an instance of the type representing the ORDER BY clause, allowing further specification of ordering or transitioning to the next query stage.