@Override public Departement update(Departement entity) { Departement dept = iDepartementDao.findOne(entity.getId()); dept.setCode(entity.getCode()); dept.setIntitule(entity.getIntitule()); dept.setAgence(iAgenceDao.findOne(entity.getAgence().getId())); return iDepartementDao.save(dept); }
@Override public Page<Departement> searchDepartements( String code, String intitule, int nombrePage, Integer size) { return iDepartementDao.searchDepartements( '%' + code + '%', '%' + intitule + '%', new PageRequest(nombrePage, size)); }
@Override public List<Departement> filterDepartementByAgenceId(long agenceId) { List<Departement> services; services = iDepartementDao.filterDepartementByAgenceId(agenceId); return services; }
@Override public List<Departement> findAll() { return iDepartementDao.findAll(); }
@Override public Departement findOne(long id) { return iDepartementDao.findOne(id); }
@Override public void deleteById(long entityId) { iDepartementDao.delete(entityId); }
@Override public void delete(Departement entity) { iDepartementDao.delete(entity); }
@Override public Departement create(Departement entity) { entity.setAgence(iAgenceDao.findOne(entity.getAgence().getId())); return iDepartementDao.save(entity); }