@Override
 public Page<ApplicationConfig> findAllApplicationConfigs(Pageable pageable) {
   if (pageable == null) {
     pageable = new PageRequest(0, 20);
   }
   return applicationConfigDao.findAll(pageable);
 }
 @Override
 public Long countApplicationConfigs(String search) {
   if (!StringUtils.hasText(search)) {
     return countAllApplicationConfigs();
   }
   return applicationConfigDao.count("%" + search + "%");
 }
 @Override
 public ApplicationConfig findApplicationConfigById(String id) {
   if (!StringUtils.hasText(id)) {
     return null;
   }
   return applicationConfigDao.findOne(id);
 }
 @Override
 public void delete(ApplicationConfig ac) {
   if (ac == null || ac.getId() == null) {
     return;
   }
   applicationConfigDao.delete(ac);
 }
  @Override
  public Page<ApplicationConfig> findApplicationConfigs(String search, Pageable pageable) {
    if (!StringUtils.hasText(search)) {
      return findAllApplicationConfigs(pageable);
    }

    if (pageable == null) {
      pageable = new PageRequest(0, 20);
    }

    return applicationConfigDao.search("%" + search + "%", pageable);
  }
 @Override
 public Long countAllApplicationConfigs() {
   return applicationConfigDao.count();
 }
 @Override
 public void save(ApplicationConfig ac) {
   applicationConfigDao.save(ac);
 }