@Test public void testFind() throws Exception { IDataSet db = database( support.loadFlatXmlDataStream(getClass(), "user.xml"), support.loadFlatXmlDataStream(getClass(), "batch.xml"), support.loadFlatXmlDataStream(getClass(), "batch_item.xml") ); support.cleanInsert(support.getConnection(tx), db); tx.commit(); BatchItem item = dao.find(1); assertNotNull(item); assertEquals(1, (int) item.getId()); }
@Override public BatchItem find(int id) { DBRecord dbr = new DBRecord(); try { dbr.read(table, id, getConnection()); BatchItem item = new BatchItem(); dbr.getBeanProperties(item); return item; } finally { dbr.close(); } }
EmpireBatchItemDao extends EmpireDao implements BatchItemDao { @Override public BatchItem find(int id) { DBRecord dbr = new DBRecord(); try { dbr.read(table, id, getConnection()); BatchItem item = new BatchItem(); dbr.getBeanProperties(item); return item; } finally { dbr.close(); } } }
EmpireBatchItemDao extends EmpireDao implements BatchItemDao { @Override public BatchItem find(int id) { DBRecord dbr = new DBRecord(); try { dbr.read(table, id, getConnection()); BatchItem item = new BatchItem(); dbr.getBeanProperties(item); return item; } finally { dbr.close(); } } EmpireBatchItemDao(ProarcDatabase db); }
EmpireBatchItemDao extends EmpireDao implements BatchItemDao { @Override public BatchItem find(int id) { DBRecord dbr = new DBRecord(); try { dbr.read(table, id, getConnection()); BatchItem item = new BatchItem(); dbr.getBeanProperties(item); return item; } finally { dbr.close(); } } 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); }
EmpireBatchItemDao extends EmpireDao implements BatchItemDao { @Override public BatchItem find(int id) { DBRecord dbr = new DBRecord(); try { dbr.read(table, id, getConnection()); BatchItem item = new BatchItem(); dbr.getBeanProperties(item); return item; } finally { dbr.close(); } } 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);  }