Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. @NodeEntity
  2. @Getter
  3. @Setter
  4. @NoArgsConstructor
  5. public class ProductRecommendation {
  6. @GraphId
  7. private Long id;
  8.  
  9. String product;
  10. @Relationship(type = "RECOMMENDS", direction = Relationship.OUTGOING)
  11. Set<ProductRecommendation> linkedProducts = new HashSet<>();
  12. }
  13.  
  14. public interface ProductRecommendationRepository extends GraphRepository<ProductRecommendation> {
  15. @Query("MATCH p=()-[r:RECOMMENDS]->() RETURN p")
  16. List<ProductRecommendation> findByRelationShipType();
  17. }
  18.  
  19. public interface ProductRecommendationRepository extends GraphRepository<ProductRecommendation> {
  20. @Query("MATCH p=()-[r:{0}]->() RETURN p")
  21. List<ProductRecommendation> findByRelationShipType(String type);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement