@Test public void testFind() throws Exception { IDataSet db = database( support.loadFlatXmlDataStream(getClass(), "user.xml"), support.loadFlatXmlDataStream(getClass(), "batch.xml") ); support.cleanInsert(support.getConnection(tx), db); tx.commit(); Batch result = dao.find(1); assertNotNull(result); assertEquals(1, (int) result.getId()); assertEquals(ConfigurationProfile.DEFAULT, result.getProfileId()); }
@Override public Batch find(int batchId) { DBRecord record = new DBRecord(); try { record.read(table, batchId, getConnection()); return getBeanProperties(record); } catch (RecordNotFoundException ex) { return null; } finally { record.close(); } }
EmpireBatchDao extends EmpireDao implements BatchDao { @Override public Batch find(int batchId) { DBRecord record = new DBRecord(); try { record.read(table, batchId, getConnection()); return getBeanProperties(record); } catch (RecordNotFoundException ex) { return null; } finally { record.close(); } } }
EmpireBatchDao extends EmpireDao implements BatchDao { @Override public Batch find(int batchId) { DBRecord record = new DBRecord(); try { record.read(table, batchId, getConnection()); return getBeanProperties(record); } catch (RecordNotFoundException ex) { return null; } finally { record.close(); } } EmpireBatchDao(ProarcDatabase db); }
EmpireBatchDao extends EmpireDao implements BatchDao { @Override public Batch find(int batchId) { DBRecord record = new DBRecord(); try { record.read(table, batchId, getConnection()); return getBeanProperties(record); } catch (RecordNotFoundException ex) { return null; } finally { record.close(); } } EmpireBatchDao(ProarcDatabase db); @Override Batch create(); @Override void update(Batch batch); @Override Batch find(int batchId); @Override Batch findForPid(String pid); @Override List<Batch> findLoadingBatches(); @Override List<BatchView> view(Integer userId, Integer batchId, State state, int offset); @Override List<BatchView> view(Integer userId, Integer batchId, Set<State> state,
            Timestamp from, Timestamp to, int offset, int maxCount, String sortBy); @Override List<BatchView> view(BatchViewFilter filter); }
EmpireBatchDao extends EmpireDao implements BatchDao { @Override public Batch find(int batchId) { DBRecord record = new DBRecord(); try { record.read(table, batchId, getConnection()); return getBeanProperties(record); } catch (RecordNotFoundException ex) { return null; } finally { record.close(); } } EmpireBatchDao(ProarcDatabase db); @Override Batch create(); @Override void update(Batch batch); @Override Batch find(int batchId); @Override Batch findForPid(String pid); @Override List<Batch> findLoadingBatches(); @Override List<BatchView> view(Integer userId, Integer batchId, State state, int offset); @Override List<BatchView> view(Integer userId, Integer batchId, Set<State> state,
            Timestamp from, Timestamp to, int offset, int maxCount, String sortBy); @Override List<BatchView> view(BatchViewFilter filter);  }