public Task updateTask(Long taskId, Task task) { if (!taskExists(taskId)) throw new TaskNotFoundException(); Task taskOnDisk = taskJpaRepository.findOne(taskId); taskOnDisk.setDescription(task.getDescription()); return saveTask(taskOnDisk); }
public Task getTaskById(Long taskId) { Task task = taskJpaRepository.findOne(taskId); if (task == null) throw new TaskNotFoundException(); return task; }