Esempio n. 1
0
  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;
  }
Esempio n. 2
0
  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;
  }
Esempio n. 3
0
  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;
  }
Esempio n. 4
0
  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;
  }
Esempio n. 5
0
 public Company save(Company company) {
   return companyRepository.save(company);
 }