return dto;
}
@SuppressWarnings("unchecked")
public BuildingFormDto getBuildingForForm(Integer buildingKey) {
Building building = gatewayDao.getBuilding(buildingKey);
if (building==null){
throw new IllegalArgumentException("Building with id=" + buildingKey +" not found.");
}
List<?> countries = getCountryList();
List<?> provinces = getProvinceListForCountry();
GeoClassificator ancestor = new GeoClassificator();
ancestor.setId(building.getAddress().getProvince().getId());
List<?> cities = getCityListForAncestor(ancestor);
List<?> objectTypes = getObjectTypesList();
List<?> dangerCategories = getDangerCategoriesList();
Organization org = getOrganization(building.getBuildingowner().getId());
BuildingFormDto dto = new BuildingFormDto();
dto.setBuilding(building);
dto.setCustomer(org);
dto.setCities((List<GeoClassificator>) cities);