-
Oct 24th, 2012, 08:16 AM
#1
Neo4j - 1:N relationship without a Set on the start node.
I'd like to have node A - that has a 1:N relationship to nodes B - but I do not want to put a Set<B> on node A (there will be unbounded Bs). I'd like to create Node A and Node Bs separately - and then create the link - and query (Page) for node Bs that are related to to Node A. From the docs - it appears the way to do this is to create a RelationshipEntity. Which I can do. But - if i DID use a Set<B> on node A - these RelationshipEntities would not be needed/created - so is there a way to make a link without using RelationshipEntities? Thanks.
M
-
Nov 2nd, 2012, 10:48 AM
#2
You should be able to create the realtionships with the template class, or using the Neo4J apis directly. If you look at the Good Relationships documentation
Example 9.2. Relating actors to movies
http://static.springsource.org/sprin...tutorial_neo4j
You will see that it is using the template to
Role role = template.createRelationshipBetween(actor,movie,
Role.class, "ACTS_IN");
Hope that helps
Mark
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules