public boolean addNewsToCompany(String companyId, News news) { Company company = companyRepository.findOne(companyId); if (!company.getNewses().contains(news)) { company.getNewses().add(news); companyRepository.save(company); return true; } return false; }
public boolean addProductToCompany(String companyId, Product product) { Company company = companyRepository.findOne(companyId); if (!company.getProducts().contains(product)) { company.getProducts().add(product); companyRepository.save(company); return true; } return false; }
public boolean addLabelToCompany(String companyId, Label label) { Company company = companyRepository.findOne(companyId); if (!company.getLabels().contains(label)) { company.getLabels().add(label); companyRepository.save(company); return true; } return false; }
public boolean addJobToCompany(String companyId, Job job) { Company company = companyRepository.findOne(companyId); if (!company.getJobs().contains(job)) { company.getJobs().add(job); companyRepository.save(company); return true; } return false; }
public Company save(Company company) { return companyRepository.save(company); }