@Test public void testView() throws Exception { IDataSet db = database( support.loadFlatXmlDataStream(getClass(), "user.xml"), support.loadFlatXmlDataStream(getClass(), "batch.xml") ); support.cleanInsert(support.getConnection(tx), db); tx.commit(); List<BatchView> view = dao.view(1, null, null, 0); assertEquals(1, view.size()); BatchView bv = view.get(0); assertEquals((Integer) 1, bv.getId()); assertEquals(Timestamp.valueOf("2013-01-17 12:12:12.000"), bv.getCreate()); assertEquals("folder/", bv.getFolder()); assertEquals("uuid:0eaa6730-9068-11dd-97de-000d606f5dc6", bv.getParentPid()); assertEquals("LOADING", bv.getState()); assertEquals(dbTimestamp, bv.getTimestamp()); assertEquals("title_folder/", bv.getTitle()); assertEquals((Integer) 1, bv.getUserId()); assertEquals("test", bv.getUserName()); assertEquals("profile.default", bv.getProfileId()); view = dao.view(1, 1, null, 0); assertEquals(1, view.size()); view = dao.view(1, null, State.LOADING, 0); assertEquals(1, view.size()); view = dao.view(1, null, State.LOADING_FAILED, 0); assertEquals(0, view.size()); view = dao.view(2, null, null, 0); assertEquals(2, view.size()); }
@Override public List<BatchView> view(Integer userId, Integer batchId, State state, int offset) { return view(userId, batchId, state == null ? null : EnumSet.of(state), null, null, offset, pageSize, table.create.getName()); }
EmpireBatchDao extends EmpireDao implements BatchDao { @Override public List<BatchView> view(Integer userId, Integer batchId, State state, int offset) { return view(userId, batchId, state == null ? null : EnumSet.of(state), null, null, offset, pageSize, table.create.getName()); } }
EmpireBatchDao extends EmpireDao implements BatchDao { @Override public List<BatchView> view(Integer userId, Integer batchId, State state, int offset) { return view(userId, batchId, state == null ? null : EnumSet.of(state), null, null, offset, pageSize, table.create.getName()); } EmpireBatchDao(ProarcDatabase db); }
EmpireBatchDao extends EmpireDao implements BatchDao { @Override public List<BatchView> view(Integer userId, Integer batchId, State state, int offset) { return view(userId, batchId, state == null ? null : EnumSet.of(state), null, null, offset, pageSize, table.create.getName()); } 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 List<BatchView> view(Integer userId, Integer batchId, State state, int offset) { return view(userId, batchId, state == null ? null : EnumSet.of(state), null, null, offset, pageSize, table.create.getName()); } 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);  }