Interface RowCountingDelete
- All Known Implementing Classes:
AbstractRelationalDataOperator,MysqlDataOperator,SimpleJsonDataOperator,SQLiteDataOperator
@Internal
public interface RowCountingDelete
A data operator that can report how many rows a delete by id actually removed (#521).
DataOperator#delById returns void, and its signature is part of the published
API, so the affected-row count travels through this internal side interface instead.
QueryImpl.delete() uses it to return the number of rows the backend removed rather than
the number the query matched. The framework's own operators implement it; a third-party
DataOperator that does not is counted by checking that the row existed immediately before
its delById and is gone after it.
- Since:
- 6.3.0
-
Method Summary
Modifier and TypeMethodDescriptionintDeletes the row with this id, exactly asDataOperator#delByIddoes, and returns the number of rows the backend removed.
-
Method Details
-
deleteByIdCounted
Deletes the row with this id, exactly asDataOperator#delByIddoes, and returns the number of rows the backend removed.- Parameters:
id- the row id, notnull- Returns:
- the number of rows removed:
0when no row had this id (for example because another writer removed it first), otherwise1
-