【发布时间】:2012-11-15 16:07:43
【问题描述】:
我想要一个 Neo4j 图表,其中所有内容都连接到参考节点 (node0)。我的想法是将node0连接到“类类型”节点(rootNode),然后将某个类的所有节点连接到它。例如:
node0 --> unique RootUser --> many User
我使用的是 SpringNeo4j,所以我用 @NodeEntity 注释了 RootUser 和 User。我不知道如何在 Spring 中将 node0 连接到 RootUser。我尝试在 RootUser 类中添加以下内容,但它不起作用(referenceNode 来自neo4jTemplate.getReferenceNode()):
@RelatedTo(type = "partition", direction = Direction.INCOMING)
private Node referenceNode;
实现这种架构的最佳方式是什么?
【问题讨论】:
标签: neo4j spring-data-neo4j spring-data-graph