Top Description Methods
org.jooq

public Interface DeleteQuery<R extends org.jooq.Record>

extends ConditionProvider, Delete<R extends Record>
Known Direct Implementers
org.jooq.impl.DeleteQueryImpl
Type Parameters
<R>
The record type of the table being deleted from
Static Imports
org.jooq.SQLDialect.FIREBIRD, .SQLDialect.H2, .SQLDialect.MARIADB, .SQLDialect.MYSQL, .SQLDialect.POSTGRES, .SQLDialect.YUGABYTEDB

Deprecated

as a consequence of ConditionProvider being deprecated. See corresponding docs for further information.

A DELETE 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

Modifier and TypeMethod and Description
public void
addConditions(Condition
The condition
condition
)

Redeclares org.jooq.ConditionProvider.addConditions.

Deprecated as a consequence of Condition being deprecated.
Adds a new condition to the query, connecting them to existing conditions with Operator#AND.
public void
addConditions(Condition...
The condition
conditions
)

Redeclares org.jooq.ConditionProvider.addConditions.

Deprecated as a consequence of Condition being deprecated.
Adds new conditions to the query, connecting them to existing conditions with Operator#AND.
public void
addConditions(Collection<? extends Condition>
The condition
conditions
)

Redeclares org.jooq.ConditionProvider.addConditions.

Adds new conditions to the query, connecting them to existing conditions with Operator#AND.
public void
addConditions(Operator operator, Condition
The condition
condition
)

Redeclares org.jooq.ConditionProvider.addConditions.

Deprecated as a consequence of Condition being deprecated.
Adds a new condition to the query, connecting them to existing conditions with the provided operator.
public void
addConditions(Operator operator, Condition...
The condition
conditions
)

Redeclares org.jooq.ConditionProvider.addConditions.

Deprecated as a consequence of Condition being deprecated.
Adds new conditions to the query, connecting them to existing conditions with the provided operator.
public void
addConditions(Operator operator, Collection<? extends Condition>
The condition
conditions
)

Redeclares org.jooq.ConditionProvider.addConditions.

Adds new conditions to the query, connecting them to existing conditions with the provided operator.
public void
addLimit(Number
The number of rows to return
numberOfRows
)

Limit the results of this select.

public void
addLimit(Field<? extends Number>
The number of rows to return
numberOfRows
)

Deprecated as a consequence of Field being deprecated.
Limit the results of this select.
public void
addOrderBy(OrderField<?>...
The ordering fields
fields
)

Adds ordering fields.

public void
addOrderBy(Collection<? extends OrderField<?>>
The ordering fields
fields
)

Adds ordering fields.

public void
addUsing(TableLike<?> table)

Add tables to the USING clause.

public void
addUsing(TableLike<?>... tables)

Add tables to the USING clause.

public void
addUsing(Collection<? extends TableLike<?>> tables)

Add tables to the USING clause.

public R

Returns:

The returned value as specified by any of the setReturning() methods. This may return null in case jOOQ could not retrieve any generated keys from the JDBC driver.
getReturnedRecord
()

The record holding returned values as specified by any of the setReturning() methods.

public @NotNull Result<R>

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.
getReturnedRecords
()

The records holding returned values as specified by any of the setReturning() methods.

public void
setReturning()

Configure the DELETE statement to return all fields in R.

public void
setReturning(SelectFieldOrAsterisk...
Fields to be returned
fields
)

Configure the DELETE statement to return a list of fields in R.

public void
setReturning(Collection<? extends SelectFieldOrAsterisk>
Fields to be returned
fields
)

Configure the DELETE statement to return a list of fields in R.

Method Detail

addConditionsback to summary
public void addConditions(Condition condition)

Redeclares org.jooq.ConditionProvider.addConditions.

Doc from org.jooq.ConditionProvider.addConditions.

Deprecated

as a consequence of Condition being deprecated. See corresponding docs for further information.

Adds a new condition to the query, connecting them to existing conditions with Operator#AND.

Parameters
condition:Condition

The condition

Annotations
@Override
@Support
addConditionsback to summary
public void addConditions(Condition... conditions)

Redeclares org.jooq.ConditionProvider.addConditions.

Doc from org.jooq.ConditionProvider.addConditions.

Deprecated

as a consequence of Condition being deprecated. See corresponding docs for further information.

Adds new conditions to the query, connecting them to existing conditions with Operator#AND.

Parameters
conditions:Condition[]

The condition

Annotations
@Override
@Support
addConditionsback to summary
public void addConditions(Collection<? extends Condition> conditions)

Redeclares org.jooq.ConditionProvider.addConditions.

Doc from org.jooq.ConditionProvider.addConditions.

Adds new conditions to the query, connecting them to existing conditions with Operator#AND.

Parameters
conditions:Collection<? extends Condition>

The condition

Annotations
@Override
@Support
addConditionsback to summary
public void addConditions(Operator operator, Condition condition)

Redeclares org.jooq.ConditionProvider.addConditions.

Doc from org.jooq.ConditionProvider.addConditions.

Deprecated

as a consequence of Condition being deprecated. See corresponding docs for further information.

Adds a new condition to the query, connecting them to existing conditions with the provided operator.

Parameters
condition:Condition

The condition

Annotations
@Override
@Support
addConditionsback to summary
public void addConditions(Operator operator, Condition... conditions)

Redeclares org.jooq.ConditionProvider.addConditions.

Doc from org.jooq.ConditionProvider.addConditions.

Deprecated

as a consequence of Condition being deprecated. See corresponding docs for further information.

Adds new conditions to the query, connecting them to existing conditions with the provided operator.

Parameters
conditions:Condition[]

The condition

Annotations
@Override
@Support
addConditionsback to summary
public void addConditions(Operator operator, Collection<? extends Condition> conditions)

Redeclares org.jooq.ConditionProvider.addConditions.

Doc from org.jooq.ConditionProvider.addConditions.

Adds new conditions to the query, connecting them to existing conditions with the provided operator.

Parameters
conditions:Collection<? extends Condition>

The condition

Annotations
@Override
@Support
addLimitback to summary
public void addLimit(Number numberOfRows)

Limit the results of this select.

Parameters
numberOfRows:Number

The number of rows to return

Annotations
@Support
addLimitback to summary
public void addLimit(Field<? extends Number> numberOfRows)

Deprecated

as a consequence of Field being deprecated. See corresponding docs for further information.

Limit the results of this select.

Parameters
numberOfRows:Field<? extends Number>

The number of rows to return

Annotations
@Support
addOrderByback to summary
public void addOrderBy(OrderField<?>... fields)

Adds ordering fields.

Parameters
fields:OrderField<?>[]

The ordering fields

Annotations
@Support
addOrderByback to summary
public void addOrderBy(Collection<? extends OrderField<?>> fields)

Adds ordering fields.

Parameters
fields:Collection<? extends OrderField<?>>

The ordering fields

Annotations
@Support
addUsingback to summary
public void addUsing(TableLike<?> table)

Add tables to the USING clause.

Annotations
@Support:MARIADB, MYSQL, POSTGRES
addUsingback to summary
public void addUsing(TableLike<?>... tables)

Add tables to the USING clause.

Annotations
@Support:MARIADB, MYSQL, POSTGRES
addUsingback to summary
public void addUsing(Collection<? extends TableLike<?>> tables)

Add tables to the USING clause.

Annotations
@Support:MARIADB, MYSQL, POSTGRES
getReturnedRecordback to summary
public R getReturnedRecord()

The record holding returned values as specified by any of the setReturning() methods.

If the DELETE statement returns several records, this is the same as calling getReturnedRecords().get(0)

This implemented differently for every dialect:

  • Firebird and Postgres have native support for DELETE … RETURNING clauses
Returns:R

The returned value as specified by any of the setReturning() methods. This may return null in case jOOQ could not retrieve any generated keys from the JDBC driver.

Annotations
@Nullable
@Support:FIREBIRD, H2, MARIADB, POSTGRES, YUGABYTEDB
See Also
getReturnedRecords()
getReturnedRecordsback to summary
public @NotNull Result<R> getReturnedRecords()

The records holding returned values as specified by any of the setReturning() methods.

If the DELETE statement returns several records, this is the same as calling getReturnedRecords().get(0)

This implemented differently for every dialect:

  • Firebird and Postgres have native support for DELETE … RETURNING clauses
Returns:@NotNull Result<R>

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.
Annotations
@NotNull
@Support:FIREBIRD, H2, MARIADB, POSTGRES, YUGABYTEDB
setReturningback to summary
public void setReturning()

Configure the DELETE statement to return all fields in R.

Annotations
@Support:FIREBIRD, H2, MARIADB, POSTGRES, YUGABYTEDB
See Also
getReturnedRecords()
setReturningback to summary
public void setReturning(SelectFieldOrAsterisk... fields)

Configure the DELETE statement to return a list of fields in R.

Parameters
fields:SelectFieldOrAsterisk[]

Fields to be returned

Annotations
@Support:FIREBIRD, H2, MARIADB, POSTGRES, YUGABYTEDB
See Also
getReturnedRecords()
setReturningback to summary
public void setReturning(Collection<? extends SelectFieldOrAsterisk> fields)

Configure the DELETE statement to return a list of fields in R.

Parameters
fields:Collection<? extends SelectFieldOrAsterisk>

Fields to be returned

Annotations
@Support:FIREBIRD, H2, MARIADB, POSTGRES, YUGABYTEDB
See Also
getReturnedRecords()