@Override public JRDataSource getCityReport() { List<City> cities = new ArrayList<>(); City city = null; List<UsCity> usCities = cityDao.getEntities(); for (UsCity usCity : usCities) { city = new City(); city.setId(usCity.getId()); city.setCityName(usCity.getCityName()); city.setState(usCity.getUsState().getStateName()); cities.add(city); } return new JRBeanCollectionDataSource(cities); }
@Override @Transactional public List<UsCity> findCitites() { return cityDao.getEntities(); }
@Override @Transactional public UsCity findCity(Long id) throws InstanceNotFoundException { return cityDao.find(id); }
@Override @Transactional public void removeCity(UsCity city) throws InstanceNotFoundException { cityDao.remove(city); }
@Override @Transactional public UsCity updateCity(UsCity city) { return cityDao.update(city); }
@Override @Transactional public Long addCity(UsCity city) { return cityDao.save(city); }
@Override public List<UsCity> getCities(Long usStateId) { return cityDao.getCities(usStateId); }