Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @NodeEntity
- @Getter
- @Setter
- @NoArgsConstructor
- public class ProductRecommendation {
- @GraphId
- private Long id;
- String product;
- @Relationship(type = "RECOMMENDS", direction = Relationship.OUTGOING)
- Set<ProductRecommendation> linkedProducts = new HashSet<>();
- }
- public interface ProductRecommendationRepository extends GraphRepository<ProductRecommendation> {
- @Query("MATCH p=()-[r:RECOMMENDS]->() RETURN p")
- List<ProductRecommendation> findByRelationShipType();
- }
- public interface ProductRecommendationRepository extends GraphRepository<ProductRecommendation> {
- @Query("MATCH p=()-[r:{0}]->() RETURN p")
- List<ProductRecommendation> findByRelationShipType(String type);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement