EmpireBatchItemDao extends EmpireDao implements BatchItemDao { @Override public void removeItems(int batchId) { DBCommand cmd = db.createCommand(); cmd.where(table.batchId.is(batchId)); db.executeDelete(table, cmd, getConnection()); } EmpireBatchItemDao(ProarcDatabase db); @Override BatchItem create(); @Override void update(BatchItem item); @Override BatchItem find(int id); @Override List<BatchItem> find(int batchId, String pid, String dsId, String state, String type); @Override void removeItems(int batchId);  }
@Test public void testRemoveItems() throws Exception { IDataSet db = database( support.loadFlatXmlDataStream(getClass(), "user.xml"), support.loadFlatXmlDataStream(getClass(), "batch_with_items.xml") ); support.cleanInsert(support.getConnection(tx), db); tx.commit(); dao.removeItems(2); tx.commit(); List<BatchItem> items = dao.find(2, null, null, null, null); assertTrue(items.isEmpty()); }