E
- the generic type of entities to delete with this querypublic class DeleteQuery<E extends SQLEntity> extends BatchQuery<E>
A query is created by enumerating which mappings to compare in order to identify entities to delete. The query is then supplied with an example entity from which the values are derived.
avarage, batchBacklog, batchBacklogLimit, context, descriptor, mappings, MAX_BATCH_BACKLOG, mixing, oma, properties, query, stmt, type
Modifier | Constructor and Description |
---|---|
protected |
DeleteQuery(BatchContext context,
Class<E> type,
String[] mappings) |
Modifier and Type | Method and Description |
---|---|
protected void |
buildSQL()
Determines the SQL statement to prepare in
BatchQuery.prepareStmt() . |
void |
delete(E example,
boolean invokeChecks,
boolean addBatch)
Deletes all entities where the compared mappings match the ones given in the example.
|
addBatch, close, commit, createStmt, getDescriptor, getProperties, prepareStmt, safeClose, toString, tryCommit, withCustomBatchLimit
protected DeleteQuery(BatchContext context, Class<E> type, String[] mappings)
public void delete(@Nonnull E example, boolean invokeChecks, boolean addBatch)
example
- the example entity used to determine which other entities to deleteinvokeChecks
- true to signal that before- and after delete checks should be executed,
false otherwiseaddBatch
- determines if the query should be executed instantly (false) or added to the
batch update (true).protected void buildSQL() throws SQLException
BatchQuery
BatchQuery.prepareStmt()
.buildSQL
in class BatchQuery<E extends SQLEntity>
SQLException
- in case of a database errorCopyright © 2018. All rights reserved.