jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Reschke <julian.resc...@gmx.de>
Subject Re: Node relationships?
Date Sun, 09 Nov 2008 13:45:38 GMT
Robert Campbell wrote:
> I'm almost done ready the JCR spec, but I don't see any mention of
> this particular problem:
> A product node can be the child of multiple category nodes (for
> example). In a RDBMS you can express relationships between entities
> however you wish, in this case I would have a cross-reference table
> with product_id and category_id, resulting in products being mapped to
> as many categories as you want. The JCR, however, lays out a pretty
> strict tree hierarchy preventing multiple parents.
> One thought is that I keep the RDBMS for relationship data, and just
> have a column in the products table for UUID pointing to the JCR
> (which would probably just be flat, each node having a UUID, and not
> utilizing the tree structure). This means the DB would have
> relationship data, and the JCR would have entity data.
> The other thought is scrap the DB and just have a multivalue Category
> property on all Product nodes containing the UUID of the Category they
> reside in. This feels a bit like a hack, however, and while removing
> the need for the DB to store relationships, it still doesn't make use
> of the tree structure.
> I can't be the first one to encounter this problem, but I can't find
> any design patterns to address it.

I think a multivalued category property should work just fine; but yes, 
it doesn't take advantage of hierarchical storage.

If you *do* want to use that, the Shareable Nodes feature specified in 
JSR-283 may be the right thing for you; essentially it allows a single 
node to appear below multiple parent nodes (it's almost a one to one 
match to the WebDAV BIND specification).

Best regards, Julian

View raw message