Class Statements

java.lang.Object
io.github.torand.fastersql.statement.Statements

public final class Statements extends Object
Provides factory methods for statements and statement builders.
  • Method Details

    • select

      public static SelectFromBuilder select(Projection firstProjection, Projection... moreProjections)
      Creates a SELECT statement builder.
      Parameters:
      firstProjection - the first projection.
      moreProjections - the other projections, if any.
      Returns:
      the statement builder.
    • selectDistinct

      public static SelectFromBuilder selectDistinct(Projection firstProjection, Projection... moreProjections)
      Creates a SELECT statement builder with DISTINCT clause added.
      Parameters:
      firstProjection - the first projection.
      moreProjections - the other projections, if any.
      Returns:
      the statement builder.
    • update

      public static UpdateStatement update(Table<?> table)
      Creates an UPDATE statement for specified table.
      Parameters:
      table - the table
      Returns:
      the statement.
    • delete

      public static DeleteFromBuilder delete()
      Creates a DELETE statement builder.
      Returns:
      the statement builder.
    • deleteFrom

      public static DeleteStatement deleteFrom(Table<?> table)
      Creates a DELETE statement with specified FROM clause.
      Parameters:
      table - the FROM clause
      Returns:
      the statement.
    • truncate

      public static TruncateTableBuilder truncate()
      Creates a TRUNCATE statement builder.
      Returns:
      the statement builder.
    • truncateTable

      public static TruncateStatement truncateTable(Table<?> table)
      Creates a TRUNCATE statement with specified TABLE clause.
      Parameters:
      table - the TABLE clause.
      Returns:
      the statement.
    • insert

      public static InsertIntoBuilder insert()
      Creates an INSERT statement builder.
      Returns:
      the statement builder.
    • insertInto

      public static InsertStatement insertInto(Table<?> table)
      Creates an INSERT statement with specified INTO clause.
      Parameters:
      table - the INTO clause.
      Returns:
      the statement builder.
    • insertBatch

      public static <T> InsertBatchIntoBuilder<T> insertBatch(Collection<T> entities)
      Creates an INSERT (batch) statement builder, for specified entities.
      Type Parameters:
      T - the entity type.
      Parameters:
      entities - the entities
      Returns:
      the statement builder.