}
@Transactional
public GeocoderResults geocode(String location) {
GeocoderResultsEntity entity = (GeocoderResultsEntity) _template.get(
GeocoderResultsEntity.class, location);
if (entity != null)
return entity.getResults();
GeocoderResults results = _geocoderService.geocode(location);
entity = new GeocoderResultsEntity();
entity.setLocation(location);
entity.setResults(results);
_template.saveOrUpdate(entity);
return results;
}