예제 #1
0
  /**
   * Load the specified Person.
   *
   * <p>Be careful when walking the tree to avoid performance issues that can arise if eager
   * fetching from the database layer is not used appropriately.
   */
  @Override
  public AccommodationForm loadForPerson(final UUID studentId) throws ObjectNotFoundException {
    final AccommodationForm form = new AccommodationForm();

    final Person person = personService.get(studentId);
    form.setPerson(person);

    return form;
  }
예제 #2
0
  /** Persist the form contents */
  @Override
  public boolean save(final AccommodationForm form) throws ObjectNotFoundException {
    if (form.getPerson() == null) {
      throw new ObjectNotFoundException("Missing (null) Person.", "Person");
    }

    final Person person = form.getPerson();

    // Save changes to persistent storage.
    personService.save(person);

    return true;
  }