@Override @Transactional(readOnly = true) public List<CountryDto> search(CountrySearchBean searchBean) throws BasicServiceException { List<CountryDto> result = new ArrayList<CountryDto>(); List<CountryEntity> entityList = countryDao.getByExample(searchBean); if (CollectionUtils.isEmpty(entityList)) throw new BasicServiceException(ErrorCodes.RECORD_NOT_FOUND); for (CountryEntity item : entityList) { result.add(toDto(item)); } return result; }
@Override public void delete(String pk) throws BasicServiceException { countryDao.delete(countryDao.findById(pk)); }
@Override public CountryDto save(CountryDto countryDto) throws BasicServiceException { // countryDao.save(toEntity(countryDto)); CountryEntity e = countryDao.save(toEntity(countryDto)); return toDto(e); }