class 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;
    }

}