public void removeFromBatch(Database db, Integer batchId, List<Integer> entityIds) throws DatabaseException, IOException { for (Integer id : entityIds) { MolgenisBatchEntity entity = new MolgenisBatchEntity(); entity.setId(id); entity.setBatch(batchId); db.remove(entity); } }