예제 #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;
  }
예제 #2
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;
  }
예제 #3
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;
  }
예제 #4
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;
  }
예제 #5
0
 public long count() {
   return companyRepository.count();
 }
예제 #6
0
 public Page<Company> findInScope(int page, int size) {
   PageRequest request = new PageRequest(page, size);
   return companyRepository.findAll(request);
 }
예제 #7
0
 public List<Company> findByCompanyNameLike(String companyName) {
   return companyRepository.findByCompanyNameLike(companyName);
 }
예제 #8
0
 public void deleteById(String id) {
   companyRepository.delete(id);
 }
예제 #9
0
 public void delete(Company company) {
   companyRepository.delete(company);
 }
예제 #10
0
 public Company save(Company company) {
   return companyRepository.save(company);
 }
예제 #11
0
 public Company findById(String id) {
   return companyRepository.findOne(id);
 }
예제 #12
0
 public List<Company> findAll() {
   return companyRepository.findAll();
 }