I'd like to have a Neo4j graph where everything is connected to the reference node (node0). My idea was to connect node0 to a 'class type' node (rootNode) and then have all the nodes of a certain class connected to it. EG:
node0 --> unique RootUser --> many User
I'm using SpringNeo4j so I annotated RootUser and User with @NodeEntity
. I have no idea of how to connect node0 to the RootUser in Spring though. I tried to add the following in the RootUser class but it does not work (referenceNode come from neo4jTemplate.getReferenceNode()
):
@RelatedTo(type = "partition", direction = Direction.INCOMING)
private Node referenceNode;
What's the best way to achieve this kind of architecture?