0
@RelationshipEntityがどのように機能するか理解できません。次の例を試してみましたが、例と同じパターンに従っているとは思っていますが、Relationship EntityがRelationshipEntityを持ちNodeEntityを取得しているため、stackoverflowで終わります。Neo4j RelationshipEntity StackOverflow
私のモデルは次のとおりです。 (:Vendor)-[:BELONGS_TO {active: true, sinceDate: date}]->(:Store)
だから私の2つのノードがベンダーと店です:
@NodeEntity
@Data
public class Vendor {
@GraphId
private Long id;
private Long vendorId;
private String name;
private String address;
@Relationship(type = "OWNS")
private Collection<Inventory> inventory;
@Relationship(type = "BELONGS_TO")
private Collection<Store> store;
}
@NodeEntity
@Data
public class Store {
@GraphId
private Long id;
private Long storeId;
private String name;
private String address;
private String email;
@Relationship(type = "BELONGS_TO", direction = Relationship.INCOMING)
private List<StoreParticipant> storeParticipant;
}
そして、私のRelationshipEntity:
@RelationshipEntity(type = "BELONGS_TO")
@Data
public class StoreParticipant {
@GraphId
private Long id;
@StartNode
private Vendor vendor;
@EndNode
private Store store;
private int count;
private double price;
private boolean negotiable;
private boolean active;
}
Iが有していた動画例のオフこれをベース(:人) - [:ACTED_IN] - >(:MOVIE)とacted_in関係がIリポジトリ方法findByVendorId
呼び出すときにこれが起こっているROLEました
@Repository
public interface VendorRepository extends GraphRepository<Vendor> {
List<Vendor> findByVendorId(Long vendorId);
}
おかげであるべきとき
Vendor
がが含まれている、ことを試みたが、まだ同じを得ます。私はちょうどベンダー - > storeParticipant - >ベンダー - > storeParticipantで、終わる。 – Tim