@Test public void testGetCronTasks() { UserInfo userInfo = new UserInfo(); userInfo.setUserId(55496072L); userInfo.setUserNick("syniiii"); userInfo.setState(UserInfo.State.normal.name()); userInfo.setVersionNo(1); userInfo.setUpdateDate(new Date()); userInfo.setSessionKey("50810117fe140343effTQTfsRj5b39dc0b779f038761bf5554960722"); userInfoDao.saveOrUpdate(userInfo); Long taskId = testAdd(); List<Object[]> result = asyncTaskDao.getCronTasks(); Assert.assertNotNull(result); asyncTaskDao.deleteById(taskId); }
@SuppressWarnings("unchecked") public List<Object[]> getCronTasks() { String hql = "from AsyncTask t,UserInfo u where t.relatedId = u.userId and u.state = ?" + " and t.state = ? and t.taskType = ? and sysdate between t.startDate and t.endDate"; List<Object[]> result = (List<Object[]>) findAllWithHql(hql, new Object[] { UserInfo.State.normal.name(), AsyncTask.State.wating_operate.name(), TaskType.cron.name() }); return result; }
AsyncTaskDao extends HibernateDao<AsyncTask, Long> { @SuppressWarnings("unchecked") public List<Object[]> getCronTasks() { String hql = "from AsyncTask t,UserInfo u where t.relatedId = u.userId and u.state = ?" + " and t.state = ? and t.taskType = ? and sysdate between t.startDate and t.endDate"; List<Object[]> result = (List<Object[]>) findAllWithHql(hql, new Object[] { UserInfo.State.normal.name(), AsyncTask.State.wating_operate.name(), TaskType.cron.name() }); return result; } }
AsyncTaskDao extends HibernateDao<AsyncTask, Long> { @SuppressWarnings("unchecked") public List<Object[]> getCronTasks() { String hql = "from AsyncTask t,UserInfo u where t.relatedId = u.userId and u.state = ?" + " and t.state = ? and t.taskType = ? and sysdate between t.startDate and t.endDate"; List<Object[]> result = (List<Object[]>) findAllWithHql(hql, new Object[] { UserInfo.State.normal.name(), AsyncTask.State.wating_operate.name(), TaskType.cron.name() }); return result; }  }
AsyncTaskDao extends HibernateDao<AsyncTask, Long> { @SuppressWarnings("unchecked") public List<Object[]> getCronTasks() { String hql = "from AsyncTask t,UserInfo u where t.relatedId = u.userId and u.state = ?" + " and t.state = ? and t.taskType = ? and sysdate between t.startDate and t.endDate"; List<Object[]> result = (List<Object[]>) findAllWithHql(hql, new Object[] { UserInfo.State.normal.name(), AsyncTask.State.wating_operate.name(), TaskType.cron.name() }); return result; }  @SuppressWarnings("unchecked") List<Object[]> getCronTasks(); AsyncTask addAsyncTask(TaskType taskType, TaskSubType taskSubType, Long userId, String cron, Date startDate,
			Date endDate, String taskData); List<AsyncTask> getShowCaseCronTasks(Long userId); int countCronTask(Long userId); List<AsyncTask> getCronTasks(long userId, int pageSize, int pageNo); }
AsyncTaskDao extends HibernateDao<AsyncTask, Long> { @SuppressWarnings("unchecked") public List<Object[]> getCronTasks() { String hql = "from AsyncTask t,UserInfo u where t.relatedId = u.userId and u.state = ?" + " and t.state = ? and t.taskType = ? and sysdate between t.startDate and t.endDate"; List<Object[]> result = (List<Object[]>) findAllWithHql(hql, new Object[] { UserInfo.State.normal.name(), AsyncTask.State.wating_operate.name(), TaskType.cron.name() }); return result; }  @SuppressWarnings("unchecked") List<Object[]> getCronTasks(); AsyncTask addAsyncTask(TaskType taskType, TaskSubType taskSubType, Long userId, String cron, Date startDate,
			Date endDate, String taskData); List<AsyncTask> getShowCaseCronTasks(Long userId); int countCronTask(Long userId); List<AsyncTask> getCronTasks(long userId, int pageSize, int pageNo);  }