Let’s say I have 3 main tables:
category, tag, url
category and tag have a MANY_MANY relationship.
tag and url have a MANY_MANY relationship.
I would like from category to retrieve all the linked url.
What is the easiest, most efficient way to do this?
Can I declare a sort of MANY_MANY_MANY relation? Or is this doable in criteria? Or do I have to do it in pure SQL?
I like the idea of Criteria because I will later pass it ‘offset’ and ‘limit’ parameters for pagination purposes…
I may have found a trick: VIEWS
I created the following view:
And I added the following relation to Category:
I haven’t done extensive testing yet. Comments welcomed.