- 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 Summary
Modifier and TypeMethodDescriptionstatic <E extends EntityBean>
CreateTableClause<E> createTable(E entity) Alternative fornew CreateTable<>(entity).static <E extends EntityBean>
DeleteFrom<E> delete(E entity) Alternative fornew Delete().from(entity).static <E extends EntityBean>
io.github.mmm.orm.statement.drop.DropTable<E> dropTable(E entity) Alternative fornew DropTable<>(entity).getStart()getType()static <E extends EntityBean>
InsertInto<E> insert(E entity) Alternative fornew Insert().into(entity).static <E extends EntityBean>
MergeInto<E> merge(E entity) Alternative fornew Merge().into(entity).static <E extends EntityBean>
SelectFrom<E, E> select(E entity) Alternative fornew SelectEntity<>(entity).from().static <R> SelectSingleClause<R> select(io.github.mmm.value.CriteriaObject<R> selection) Alternative fornew SelectSingle<>(selection).static <R extends io.github.mmm.bean.WritableBean>
SelectProjectionClause<R> selectProjection(R bean) Alternative fornew SelectProjection<>(bean).static SelectStatement<Long> selectSeqNextVal(DbName sequenceName) static SelectStatement<Long> selectSeqNextVal(DbQualifiedName sequenceName) static <E extends EntityBean>
UpdateClause<E> update(E entity) Alternative fornew Update<>(entity).static <E extends EntityBean>
UpsertInto<E> upset(E entity) Alternative fornew Upsert().into(entity).Methods inherited from interface io.github.mmm.marshall.MarshallableObject
write, writeObjectMethods inherited from interface io.github.mmm.marshall.UnmarshallableObject
read, readObject
-
Method Details
-
getStart
StartClause getStart()- Returns:
- the
StartClause
-
getClauses
- Returns:
- the
ListofDbClauses thisDbStatementis composed of. Please note that this is a generic API. Specific sub-classes implementingDbStatementwill have dedicated getters for each type ofDbClause.
-
getType
DbStatementType getType() -
select
Alternative fornew SelectEntity<>(entity).from().- Type Parameters:
E- type of theEntityBeanto select.- Parameters:
entity- theEntityBeanto select.- Returns:
- the
SelectEntityClauseclause.
-
select
Alternative fornew SelectSingle<>(selection).- Type Parameters:
R- type of the result of the selection.- Parameters:
selection- the singleCriteriaObjectto select.- Returns:
- the new
SelectSingleClauseclause.
-
selectProjection
static <R extends io.github.mmm.bean.WritableBean> SelectProjectionClause<R> selectProjection(R bean) Alternative fornew SelectProjection<>(bean).- Type Parameters:
R- type of theWritableBeanto select.- Parameters:
bean- theWritableBeanto select.- Returns:
- the new
SelectProjectionClauseclause.
-
selectSeqNextVal
- Parameters:
sequenceName- theDbNameof the sequence to select.- Returns:
- the
SelectStatementto select the next value from the specified sequence.
-
selectSeqNextVal
- Parameters:
sequenceName- theDbQualifiedNameof the sequence to select.- Returns:
- the
SelectStatementto select the next value from the specified sequence.
-
delete
Alternative fornew Delete().from(entity).- Type Parameters:
E- type of theEntityBeanto delete.- Parameters:
entity- theEntityBeanto delete.- Returns:
- the
DeleteFromclause.
-
insert
Alternative fornew Insert().into(entity).- Type Parameters:
E- type of theEntityBeanto insert.- Parameters:
entity- theEntityBeanto insert.- Returns:
- the
InsertIntoclause.
-
update
Alternative fornew Update<>(entity).- Type Parameters:
E- type of theEntityBeanto update.- Parameters:
entity- theEntityBeanto update.- Returns:
- the
UpdateClauseclause.
-
upset
Alternative fornew Upsert().into(entity).- Type Parameters:
E- type of theEntityBeanto update.- Parameters:
entity- theEntityBeanto update.- Returns:
- the
UpsertIntoclause.
-
merge
Alternative fornew Merge().into(entity).- Type Parameters:
E- type of theEntityBeanto update.- Parameters:
entity- theEntityBeanto update.- Returns:
- the
UpsertIntoclause.
-
createTable
Alternative fornew CreateTable<>(entity).- Type Parameters:
E- type of theEntityBeanto create the table for.- Parameters:
entity- theEntityBeanto create the table for.- Returns:
- the
CreateTableClauseclause.
-
dropTable
Alternative fornew DropTable<>(entity).- Type Parameters:
E- type of theEntityBeanto drop the table.- Parameters:
entity- theEntityBeanto create drop the table.- Returns:
- the
DropTableclause.
-