Database Reference
In-Depth Information
// add the distance in miles to locations
addDistanceTo(locations, lat, lon);
return locations;
}
catch (Exception e) {
log.error(e);
return null;
}
}
Figure 12-16. Searching for Locations within a certain distance of User location
Locations with Product
To search for products nearby, as shown in Figure 12-17 , the application makes use of an auto-suggest AJAX request,
which ultimately calls the search method in the ProductDAO service class. The method, shown in Listing 12-42, returns
an array of objects to the product field in the search form and applies the selected product's productNodeId to the
subsequent location search.
For almost all cases, it is recommended not to use the graphId as it can be recycled when its node is deleted.
In this case, the productNodeId is safe to use, because products would not be in danger of being deleted but only
removed from a Location relationship.
 
Search WWH ::




Custom Search