1 Reply Latest reply on Oct 4, 2012 9:56 AM by biosopher

    Best practices for one-to-many relations between nodes

    biosopher

      What's the best way to create one-to-many relations between nodes?

       

      1. Add a property with the path to a related nodes as a String[].

      2. ???

      3. ???

       

      #1 could easily break if a related node was deleted.  In a relational db, it's easy to add relationships so that deleting a related node causes it's relationships to be automatically cleaned up.  Seems I'd have to write that cleanup code myself in option #1.

       

      Are there other options (#2, #3, ...) or is #1 the only way to relate nodes in a JCR?