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 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 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 long count() { return companyRepository.count(); }
public Page<Company> findInScope(int page, int size) { PageRequest request = new PageRequest(page, size); return companyRepository.findAll(request); }
public List<Company> findByCompanyNameLike(String companyName) { return companyRepository.findByCompanyNameLike(companyName); }
public void deleteById(String id) { companyRepository.delete(id); }
public void delete(Company company) { companyRepository.delete(company); }
public Company save(Company company) { return companyRepository.save(company); }
public Company findById(String id) { return companyRepository.findOne(id); }
public List<Company> findAll() { return companyRepository.findAll(); }