Database Reference
In-Depth Information
ResultSetMapper<MappedProductUserPurchase> resultSetMapper =
new ResultSetMapper<MappedProductUserPurchase>();
return resultSetMapper
.mapResultSetToListMappedClass(rs, MappedProductUserPurchase.class);
}
catch (Exception e) {
log.error(e);
return null;
}
}
Products Purchased by Friends Nearby and Matches User's Tags
Finding products of friends nearby who have purchased a product that also matches a user's tags is done by the
friendsPurchaseTagSimilarityAndProximityToLocation method, easily the world's longest method name and is
located in the PurchaseDAO class (Listing 12-49).
Listing 12-49. The friendsPurchaseTagSimilarityAndProximityToLocation Method in the IntentAction Class
@Action(value = "intent/friendsPurchaseTagSimilarityAndProximityToLocation", results = {
@Result(name = "success", type = "mustache", location =
"/mustache/html/graphs/intent/index.html")
})
public String friendsPurchaseTagSimilarityAndProximityToLocation() {
setTitle("Products Purchased by Friends Nearby and Matches User's Tags");
try {
mappedUserLocation = graphStoryDAO.getUserDAO()
.getUserLocation(
cookiesMap.get(GraphStoryConstants.graphstoryUserAuthKey)
);
graphStory.setUser(graphStoryDAO.getUserDAO()
.getByUserName(
cookiesMap.get(GraphStoryConstants.graphstoryUserAuthKey)
)));
graphStory.setMappedProductUserPurchaseList(graphStoryDAO.getPurchaseDAO()
.friendsPurchaseTagSimilarityAndProximityToLocation(
mappedUserLocation.getLat(),
mappedUserLocation.getLon(),
new Double("10.00"),
cookiesMap.get(GraphStoryConstants.graphstoryUserAuthKey)
));
 
Search WWH ::




Custom Search