[jOOQ/jOOQ#13260] Add DAO.deleteById(T) overload

This commit is contained in:
Lukas Eder 2022-03-10 17:12:05 +01:00
parent e515046d93
commit cbb7a7681c
2 changed files with 15 additions and 0 deletions

View File

@ -246,6 +246,16 @@ public interface DAO<R extends TableRecord<R>, P, T> {
@Support
void delete(Collection<P> objects) throws DataAccessException;
/**
* Performs a <code>DELETE</code> statement for a given set of IDs.
*
* @param ids The IDs to be deleted
* @throws DataAccessException if something went wrong executing the query
* @see #delete(Collection)
*/
@Support
void deleteById(T id) throws DataAccessException;
/**
* Performs a <code>DELETE</code> statement for a given set of IDs.
*

View File

@ -270,6 +270,11 @@ public abstract class DAOImpl<R extends UpdatableRecord<R>, P, T> implements DAO
records(objects, true).get(0).delete();
}
@Override
public /* non-final */ void deleteById(T ids) {
deleteById(singletonList(ids));
}
@SuppressWarnings("unchecked")
@Override
public /* non-final */ void deleteById(T... ids) {