@Override public ArrayList<Company> getByName(String name) { LOGGER.info("Get company by name: " + name); companyValidator.checkName(name); return companyDao.getByName(name); }
@Override public Company getById(long id) { LOGGER.info("Get company by id: " + id); companyValidator.checkId(id); return companyDao.getById(id); }
@Override @Transactional(readOnly = false) public void deleteCompany(long id) { LOGGER.info("Delete company by id: " + id); companyValidator.checkId(id); // We first delete all the computers associated to the company that // we will delete computerDao.deleteComputersForCompanyId(id); // And finally we delete the company itself companyDao.deleteCompany(id); }
@Override public ArrayList<Company> listCompanies() { LOGGER.info("List companies: "); return companyDao.listCompanies(); }