Results 1 to 2 of 2

Thread: Neo4j - 1:N relationship without a Set on the start node.

  1. #1
    Join Date
    Feb 2012
    Posts
    20

    Default 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

  2. #2
    Join Date
    Jan 2009
    Location
    Huntington Beach, CA
    Posts
    718

    Default

    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
  •