示例#1
0
  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);
  }
示例#2
0
 public Task getTaskById(Long taskId) {
   Task task = taskJpaRepository.findOne(taskId);
   if (task == null) throw new TaskNotFoundException();
   return task;
 }