public List<Product> getProductsToDisplayForTheme(String theme) { List<Product> products; if (!StringUtils.equalsIgnoreCase(theme, "ubs")) { Company provider = this.companyDAO.findProvider(theme); products = new LinkedList<Product>(provider.getProducts()); } else { if (logger.isInfoEnabled()) { logger.info("ubs theme passed in. returning all products."); } products = new LinkedList<Product>(this.productDAO.readAllProducts()); } return products; }
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); }