-
- Type Parameters:
R
- The record type of the table being deleted from
- All Superinterfaces:
Attachable
,AutoCloseable
,ConditionProvider
,Delete<R>
,Flow.Publisher<Integer>
,org.reactivestreams.Publisher<Integer>
,Query
,QueryPart
,RowCountQuery
,Serializable
,Statement
public interface DeleteQuery<R extends Record> extends ConditionProvider, Delete<R>
ADELETE
statement (model API).This type is the model API representation of a
Delete
statement, which can be mutated after creation. The advantage of this API compared to the DSL API is a more simple approach to writing dynamic SQL.Instances can be created using
DSLContext.deleteQuery(Table)
.- Author:
- Lukas Eder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addConditions(Collection<? extends Condition> conditions)
Adds new conditions to the query, connecting them to existing conditions withOperator.AND
.void
addConditions(Condition condition)
Adds a new condition to the query, connecting them to existing conditions withOperator.AND
.void
addConditions(Condition... conditions)
Adds new conditions to the query, connecting them to existing conditions withOperator.AND
.void
addConditions(Operator operator, Collection<? extends Condition> conditions)
Adds new conditions to the query, connecting them to existing conditions with the provided operator.void
addConditions(Operator operator, Condition condition)
Adds a new condition to the query, connecting them to existing conditions with the provided operator.void
addConditions(Operator operator, Condition... conditions)
Adds new conditions to the query, connecting them to existing conditions with the provided operator.void
addLimit(Number numberOfRows)
Limit the results of this select.void
addLimit(Param<? extends Number> numberOfRows)
Limit the results of this select using named parameters.void
addOrderBy(Collection<? extends OrderField<?>> fields)
Adds ordering fields.void
addOrderBy(OrderField<?>... fields)
Adds ordering fields.void
addUsing(Collection<? extends TableLike<?>> tables)
Add tables to theUSING
clause.void
addUsing(TableLike<?> table)
Add tables to theUSING
clause.void
addUsing(TableLike<?>... tables)
Add tables to theUSING
clause.R
getReturnedRecord()
The record holding returned values as specified by any of thesetReturning()
methods.@NotNull Result<R>
getReturnedRecords()
The records holding returned values as specified by any of thesetReturning()
methods.void
setReturning()
Configure theDELETE
statement to return all fields inR
.void
setReturning(Collection<? extends SelectFieldOrAsterisk> fields)
Configure theDELETE
statement to return a list of fields inR
.void
setReturning(SelectFieldOrAsterisk... fields)
Configure theDELETE
statement to return a list of fields inR
.-
Methods inherited from interface org.jooq.Attachable
attach, configuration, detach
-
Methods inherited from interface java.util.concurrent.Flow.Publisher
subscribe
-
Methods inherited from interface org.jooq.Query
bind, bind, cancel, close, execute, executeAsync, executeAsync, getBindValues, getParam, getParams, getSQL, getSQL, getSQL, isExecutable, keepStatement, poolable, queryTimeout
-
-
-
-
Method Detail
-
addUsing
@Support(POSTGRES) void addUsing(Collection<? extends TableLike<?>> tables)
Add tables to theUSING
clause.
-
addConditions
@Support void addConditions(Condition condition)
Description copied from interface:ConditionProvider
Adds a new condition to the query, connecting them to existing conditions withOperator.AND
.- Specified by:
addConditions
in interfaceConditionProvider
- Parameters:
condition
- The condition
-
addConditions
@Support void addConditions(Condition... conditions)
Description copied from interface:ConditionProvider
Adds new conditions to the query, connecting them to existing conditions withOperator.AND
.- Specified by:
addConditions
in interfaceConditionProvider
- Parameters:
conditions
- The condition
-
addConditions
@Support void addConditions(Collection<? extends Condition> conditions)
Description copied from interface:ConditionProvider
Adds new conditions to the query, connecting them to existing conditions withOperator.AND
.- Specified by:
addConditions
in interfaceConditionProvider
- Parameters:
conditions
- The condition
-
addConditions
@Support void addConditions(Operator operator, Condition condition)
Description copied from interface:ConditionProvider
Adds a new condition to the query, connecting them to existing conditions with the provided operator.- Specified by:
addConditions
in interfaceConditionProvider
condition
- The condition
-
addConditions
@Support void addConditions(Operator operator, Condition... conditions)
Description copied from interface:ConditionProvider
Adds new conditions to the query, connecting them to existing conditions with the provided operator.- Specified by:
addConditions
in interfaceConditionProvider
conditions
- The condition
-
addConditions
@Support void addConditions(Operator operator, Collection<? extends Condition> conditions)
Description copied from interface:ConditionProvider
Adds new conditions to the query, connecting them to existing conditions with the provided operator.- Specified by:
addConditions
in interfaceConditionProvider
conditions
- The condition
-
addOrderBy
@Support void addOrderBy(OrderField<?>... fields)
Adds ordering fields.- Parameters:
fields
- The ordering fields
-
addOrderBy
@Support void addOrderBy(Collection<? extends OrderField<?>> fields)
Adds ordering fields.- Parameters:
fields
- The ordering fields
-
addLimit
@Support void addLimit(Number numberOfRows)
Limit the results of this select.- Parameters:
numberOfRows
- The number of rows to return
-
addLimit
@Support void addLimit(Param<? extends Number> numberOfRows)
Limit the results of this select using named parameters.- Parameters:
numberOfRows
- The number of rows to return
-
setReturning
@Support({AURORA_POSTGRES,COCKROACHDB,DB2,FIREBIRD,MARIADB_10_1,ORACLE,POSTGRES}) void setReturning()
Configure theDELETE
statement to return all fields inR
.- See Also:
getReturnedRecords()
-
setReturning
@Support({AURORA_POSTGRES,COCKROACHDB,DB2,FIREBIRD,MARIADB_10_1,ORACLE,POSTGRES}) void setReturning(SelectFieldOrAsterisk... fields)
Configure theDELETE
statement to return a list of fields inR
.- Parameters:
fields
- Fields to be returned- See Also:
getReturnedRecords()
-
setReturning
@Support({AURORA_POSTGRES,COCKROACHDB,DB2,FIREBIRD,MARIADB_10_1,ORACLE,POSTGRES}) void setReturning(Collection<? extends SelectFieldOrAsterisk> fields)
Configure theDELETE
statement to return a list of fields inR
.- Parameters:
fields
- Fields to be returned- See Also:
getReturnedRecords()
-
getReturnedRecord
@Nullable @Support({AURORA_POSTGRES,COCKROACHDB,DB2,FIREBIRD,MARIADB_10_1,ORACLE,POSTGRES}) R getReturnedRecord()
The record holding returned values as specified by any of thesetReturning()
methods.If the
DELETE
statement returns several records, this is the same as callinggetReturnedRecords().get(0)
This implemented differently for every dialect:
- Firebird and Postgres have native support for
DELETE .. RETURNING
clauses
- Returns:
- The returned value as specified by any of the
setReturning()
methods. This may returnnull
in case jOOQ could not retrieve any generated keys from the JDBC driver. - See Also:
getReturnedRecords()
- Firebird and Postgres have native support for
-
getReturnedRecords
@NotNull @Support({AURORA_POSTGRES,COCKROACHDB,DB2,FIREBIRD,MARIADB_10_1,ORACLE,POSTGRES}) @NotNull Result<R> getReturnedRecords()
The records holding returned values as specified by any of thesetReturning()
methods.If the
DELETE
statement returns several records, this is the same as callinggetReturnedRecords().get(0)
This implemented differently for every dialect:
- Firebird and Postgres have native support for
DELETE .. RETURNING
clauses
- Returns:
- The returned values as specified by any of the
setReturning()
methods. Note:- Not all databases / JDBC drivers support returning several values on multi-row inserts!
- This may return an empty
Result
in case jOOQ could not retrieve any generated keys from the JDBC driver.
- Firebird and Postgres have native support for
-
-