예제 #1
0
  public void updateAdvisorDetails(Advisor advisor, Advisorfirm advisorfirm) {
    Advisor persistentAdvisor = this.advisorDAO.findById(advisor.getId());

    persistentAdvisor.setAssistantname(advisor.getAssistantname());
    persistentAdvisor.setAssistantemail(advisor.getAssistantemail());

    Individual persistentIndividual = persistentAdvisor.getIndividual();
    Individual transientIndividual = advisor.getIndividual();

    persistentIndividual.setTitle(transientIndividual.getTitle());
    persistentIndividual.setFirstname(transientIndividual.getFirstname());
    persistentIndividual.setLastname(transientIndividual.getLastname());
    persistentIndividual.setWorkphone(transientIndividual.getWorkphone());
    persistentIndividual.setMobilephone(transientIndividual.getMobilephone());
    persistentIndividual.setWorkfax(transientIndividual.getWorkfax());
    persistentIndividual.setWorkemail(transientIndividual.getWorkemail());

    Company persistentAdvisorFirmCompany = persistentAdvisor.getAdvisorfirm().getCompany();
    Company tranientAdvisorFirmCompany = advisorfirm.getCompany();

    persistentAdvisorFirmCompany.setName(tranientAdvisorFirmCompany.getName());
    persistentAdvisorFirmCompany.setAbn(tranientAdvisorFirmCompany.getAbn());
    persistentAdvisorFirmCompany.setAddress1(tranientAdvisorFirmCompany.getAddress1());
    persistentAdvisorFirmCompany.setSuburb(tranientAdvisorFirmCompany.getSuburb());
    persistentAdvisorFirmCompany.setState(tranientAdvisorFirmCompany.getState());
    persistentAdvisorFirmCompany.setPostcode(tranientAdvisorFirmCompany.getPostcode());

    this.advisorDAO.updateAdvisorDetails(persistentAdvisor);
  }