Database Reference
In-Depth Information
graphStory.setMappedProductUserPurchaseList(graphStoryDAO.getPurchaseDAO()
.friendsPurchaseByProduct(
producttitle,
cookiesMap.get(GraphStoryConstants.graphstoryUserAuthKey)
));
graphStory.setUser(graphStoryDAO.getUserDAO()
.getByUserName(
cookiesMap.get(GraphStoryConstants.graphstoryUserAuthKey)
));
}
catch (Exception e) {
log.error(e);
}
return SUCCESS;
}
// a specific product purchased by friends
public List<MappedProductUserPurchase> friendsPurchaseByProduct(String title, String username) {
try {
ResultSet rs = cypher.resultSetQuery(
"MATCH (p:Product) " +
" WHERE lower(p.title) =lower({1}) " +
" WITH p " +
“ MATCH (u:User { username : {2} } )-[:FOLLOWS]-(f)-[:MADE]->()-[:CONTAINS]->(p) " +
" RETURN p.productId as productId, " +
" p.title as title, " +
" collect(f.firstname + ' ' + f.lastname) as fullname, " +
" null as wordPhrase, count(f) as cfriends " +
"ORDER BY cfriends desc, p.title ",
map("1", title, "2", username));
ResultSetMapper<MappedProductUserPurchase> resultSetMapper =
new ResultSetMapper<MappedProductUserPurchase>();
return resultSetMapper
.mapResultSetToListMappedClass(rs, MappedProductUserPurchase.class);
}
catch (Exception e) {
log.error(e);
return null;
}
}
 
Search WWH ::




Custom Search