TaskSqlDao extends BaseDao { public List<TaskSqlView> updateAndGetAllTasks(Long projectId) throws SQLException { List<TaskSqlView> result = new ArrayList<>(); List<TaskSqlView> list = getTasksByProjectId(projectId); if (list == null || list.size() == 0) { return result; } for (TaskSqlView entity : list) { entity.setGenerated(true); if (updateTask(entity) > 0) { result.add(entity); } } return result; }  List<TaskSqlView> getTasksByProjectId(Long projectId); List<TaskSqlView> updateAndGetAllTasks(Long projectId); List<TaskSqlView> updateAndGetTasks(Long projectId); Long insertTask(TaskSql task); int updateTask(TaskSqlView task);  }
@Test public void updateAndGetAllTasks() throws Exception { List<TaskSqlView> list = taskSqlDao.updateAndGetAllTasks(186L); System.out.println("updateAndGetAllTasks :-------> " + list); Assert.assertTrue(list.size() > 0); }