Nested pull related.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Nested pull related.

Nathan Keiter

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

 

--
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 [hidden email].
To post to this group, send email to [hidden email].
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 | Threaded
Open this post in threaded view
|

RE: Nested pull related.

Nathan Keiter

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

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Nathan Keiter
Sent: Friday, July 28, 2017 10:52 AM
To: [hidden email]
Subject: [dotcms] Nested pull related.

 

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

 

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/b1eec7afbe9e493498a74af28438547e%40exch13c.ms.gettysburg.edu.
For more options, visit https://groups.google.com/d/optout.