Interface DbStatement<E>

Type Parameters:
E - type of the entity or object this statement primarily operates on.
All Superinterfaces:
io.github.mmm.marshall.MarshallableObject, io.github.mmm.marshall.Marshaller<Object>, io.github.mmm.marshall.Marshalling<Object>, io.github.mmm.marshall.MarshallingObject, io.github.mmm.marshall.UnmarshallableObject, io.github.mmm.marshall.Unmarshaller<Object>
All Known Implementing Classes:
AbstractDbStatement, CreateIndexStatement, CreateSequenceStatement, CreateTableStatement, DeleteStatement, InsertStatement, IntoValuesStatement, MergeStatement, SelectStatement, UpdateStatement, UpsertStatement

public interface DbStatement<E> extends io.github.mmm.marshall.MarshallingObject
A complete SQL statement that may be executed to the database.
Since:
1.0.0
  • Method Details

    • getStart

      StartClause getStart()
      Returns:
      the StartClause
    • getClauses

      List<? extends DbClause> getClauses()
      Returns:
      the List of DbClauses this DbStatement is composed of. Please note that this is a generic API. Specific sub-classes implementing DbStatement will have dedicated getters for each type of DbClause.
    • getType

      DbStatementType getType()
      Returns:
      the type of this statement.
    • select

      static <E extends EntityBean> SelectFrom<E,E> select(E entity)
      Alternative for new SelectEntity<>(entity).from().
      Type Parameters:
      E - type of the EntityBean to select.
      Parameters:
      entity - the EntityBean to select.
      Returns:
      the SelectEntityClause clause.
    • select

      static <R> SelectSingleClause<R> select(io.github.mmm.value.CriteriaObject<R> selection)
      Alternative for new SelectSingle<>(selection).
      Type Parameters:
      R - type of the result of the selection.
      Parameters:
      selection - the single CriteriaObject to select.
      Returns:
      the new SelectSingleClause clause.
    • selectProjection

      static <R extends io.github.mmm.bean.WritableBean> SelectProjectionClause<R> selectProjection(R bean)
      Alternative for new SelectProjection<>(bean).
      Type Parameters:
      R - type of the WritableBean to select.
      Parameters:
      bean - the WritableBean to select.
      Returns:
      the new SelectProjectionClause clause.
    • selectSeqNextVal

      static SelectStatement<Long> selectSeqNextVal(DbName sequenceName)
      Parameters:
      sequenceName - the DbName of the sequence to select.
      Returns:
      the SelectStatement to select the next value from the specified sequence.
    • selectSeqNextVal

      static SelectStatement<Long> selectSeqNextVal(DbQualifiedName sequenceName)
      Parameters:
      sequenceName - the DbQualifiedName of the sequence to select.
      Returns:
      the SelectStatement to select the next value from the specified sequence.
    • delete

      static <E extends EntityBean> DeleteFrom<E> delete(E entity)
      Alternative for new Delete().from(entity).
      Type Parameters:
      E - type of the EntityBean to delete.
      Parameters:
      entity - the EntityBean to delete.
      Returns:
      the DeleteFrom clause.
    • insert

      static <E extends EntityBean> InsertInto<E> insert(E entity)
      Alternative for new Insert().into(entity).
      Type Parameters:
      E - type of the EntityBean to insert.
      Parameters:
      entity - the EntityBean to insert.
      Returns:
      the InsertInto clause.
    • update

      static <E extends EntityBean> UpdateClause<E> update(E entity)
      Alternative for new Update<>(entity).
      Type Parameters:
      E - type of the EntityBean to update.
      Parameters:
      entity - the EntityBean to update.
      Returns:
      the UpdateClause clause.
    • upset

      static <E extends EntityBean> UpsertInto<E> upset(E entity)
      Alternative for new Upsert().into(entity).
      Type Parameters:
      E - type of the EntityBean to update.
      Parameters:
      entity - the EntityBean to update.
      Returns:
      the UpsertInto clause.
    • merge

      static <E extends EntityBean> MergeInto<E> merge(E entity)
      Alternative for new Merge().into(entity).
      Type Parameters:
      E - type of the EntityBean to update.
      Parameters:
      entity - the EntityBean to update.
      Returns:
      the UpsertInto clause.
    • createTable

      static <E extends EntityBean> CreateTableClause<E> createTable(E entity)
      Alternative for new CreateTable<>(entity).
      Type Parameters:
      E - type of the EntityBean to create the table for.
      Parameters:
      entity - the EntityBean to create the table for.
      Returns:
      the CreateTableClause clause.
    • dropTable

      static <E extends EntityBean> io.github.mmm.orm.statement.drop.DropTable<E> dropTable(E entity)
      Alternative for new DropTable<>(entity).
      Type Parameters:
      E - type of the EntityBean to drop the table.
      Parameters:
      entity - the EntityBean to create drop the table.
      Returns:
      the DropTable clause.