Skip to content

Commit

Permalink
[jOOQ#5256] DAO.delete() should delete via UpdatableRecord.delete(), …
Browse files Browse the repository at this point in the history
…not via a bulk delete
  • Loading branch information
lukaseder committed May 12, 2016
1 parent ede1ae3 commit 60ff1c9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions jOOQ/src/main/java/org/jooq/impl/DAOImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,16 @@ else if (objects.size() == 1) {

@Override
public /* non-final */ void delete(Collection<P> objects) {
List<T> ids = new ArrayList<T>();

for (P object : objects) {
ids.add(getId(object));
// Execute a batch DELETE
if (objects.size() > 1) {
using(configuration).batchDelete(records(objects, true)).execute();
}

deleteById(ids);
// Execute a regular DELETE
else if (objects.size() == 1) {
records(objects, true).get(0).delete();
}
}

@SuppressWarnings("unchecked")
Expand Down

0 comments on commit 60ff1c9

Please sign in to comment.