Nested pull related.

19 views
Skip to first unread message

Nathan Keiter

unread,
Jul 28, 2017, 10:52:15 AM7/28/17
to dot...@googlegroups.com

What is the best strategy for complex relationships?

 

I want all A’s with property X, which are related to all B’s with property Y, which are related to C’s with property Z.

 

Or similar but simpler; all A’s related to all B’s related to C’s with property Z.

 

A depth of 2 can be easily accomplished with a ContentUtils.pullRelated( relationship, id, subquery, false, 0, sort, user, tmDate );

 

A depth of 3 or 4 is what I’m asking about.

 

In a database I’d just join on foreign keys or do “IN” sub clauses.

 

I’m trying to avoid a lot of looping and manual filtering.  I was hoping that using relationships would make the data relational, and it is, but accessing it is more cumbersome than I had hoped.

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

 

Nathan Keiter

unread,
Jul 28, 2017, 4:54:11 PM7/28/17
to dot...@googlegroups.com

Could I work backwards?

 

pullRelated with subquery on “C”, and indicate I want the parents “B”.

 

Then pullRelated with subquery on “B”, and indicate I want the parents “A”.

 

If there’s no API options I’ll just have to do it in SQL at the DB level…

 

Nathan I. Keiter | Lead Network Applications Programmer | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

 

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To post to this group, send email to dot...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/256f9ca373fe480cac813c763ada6588%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages