java.lang.Object
io.github.torand.fastersql.function.aggregate.CountAll
All Implemented Interfaces:
Expression, AggregateFunction, ColumnFunction, Function, OrderExpression, LeftOperand, Projection, Sql

public class CountAll extends Object implements AggregateFunction
Implements the count all aggregate function.
  • Method Details

    • sql

      public String sql(Context context)
      Description copied from interface: Sql
      Formats object as an SQL fragment.
      Specified by:
      sql in interface Sql
      Parameters:
      context - the context (incl. dialect).
      Returns:
      the formatted SQL fragment.
    • params

      public Stream<Object> params(Context context)
      Description copied from interface: Sql
      Gets the statement parameters introduced by this fragment.
      Specified by:
      params in interface Sql
      Parameters:
      context - the context (incl. dialect).
      Returns:
      the statement parameters.
    • columnRefs

      public Stream<Column> columnRefs()
      Description copied from interface: Sql
      Gets the columns referenced by this fragment. For validation purposes.
      Specified by:
      columnRefs in interface Sql
      Returns:
      the columns referenced by this fragment.
    • aliasRefs

      public Stream<ColumnAlias> aliasRefs()
      Description copied from interface: Sql
      Gets the column aliases referenced by this fragment. For validation purposes.
      Specified by:
      aliasRefs in interface Sql
      Returns:
      the column aliases referenced by this fragment.
    • as

      public Projection as(String alias)
      Description copied from interface: Projection
      Assigns a column alias (label) for this projection.
      Specified by:
      as in interface Projection
      Parameters:
      alias - the column alias or label.
      Returns:
      the projection with specified alias assigned.
    • alias

      public Optional<ColumnAlias> alias()
      Description copied from interface: Projection
      Gets the column alias (label) assigned for this projection.
      Specified by:
      alias in interface Projection
      Returns:
      the column alias (label) assigned for this projection.
    • ascIf

      public Order ascIf(boolean condition)
      Description copied from interface: OrderExpression
      Creates an ordering of this expression, based on a condition. If condition is true, an ascending ordering is created. If condition is false, a descending ordering is created.
      Specified by:
      ascIf in interface OrderExpression
      Parameters:
      condition - the condition.
      Returns:
      the order clause.
    • asc

      public Order asc()
      Description copied from interface: OrderExpression
      Creates an ascending ordering of this expression.
      Specified by:
      asc in interface OrderExpression
      Returns:
      the order clause.
    • desc

      public Order desc()
      Description copied from interface: OrderExpression
      Creates a descending ordering of this expression.
      Specified by:
      desc in interface OrderExpression
      Returns:
      the order clause.