@Test public void testViewSort() 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(); List<BatchView> view = dao.view(null, null, null, null, null, 0, 100, "-create"); assertEquals(3, view.size()); assertEquals((Integer) 3, view.get(0).getId()); assertEquals((Integer) 2, view.get(1).getId()); view = dao.view(null, null, null, null, null, 0, 100, "create"); assertEquals(3, view.size()); assertEquals((Integer) 1, view.get(0).getId()); assertEquals((Integer) 2, view.get(1).getId()); view = dao.view(null, null, EnumSet.of(State.LOADING, State.LOADED), null, null, 0, 100, "-estimateItemNumber"); assertEquals(3, view.size()); assertEquals((Integer) 3, view.get(0).getId()); assertEquals((Integer) 2, view.get(1).getId()); }
@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);  }