Skip to content

Commit cecec26

Browse files
authored
PR for addQueryFactorySubselect depricated method
apex-enterprise-patterns#92 This was discussed and closed out earlier, but I don't see any evidence of the new methods in the project. The code coverage is a bit low on the fflib_SObjectSelectorTest but I'll see if I can improve that and get a PR in for that too.
1 parent 4a49d07 commit cecec26

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

fflib/src/classes/fflib_SObjectSelector.cls

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,23 @@ public abstract with sharing class fflib_SObjectSelector
350350
includeSelectorFields);
351351
}
352352

353+
/**
354+
* Adds a subselect QueryFactory based on this selector to the given QueryFactor, returns the parentQueryFactory
355+
**/
356+
public fflib_QueryFactory addQueryFactorySubselect(fflib_QueryFactory parentQueryFactory, String relationshipName)
357+
{
358+
return addQueryFactorySubselect(parentQueryFactory, relationshipName, TRUE);
359+
}
360+
361+
/**
362+
* Adds a subselect QueryFactory based on this selector to the given QueryFactor
363+
**/
364+
public fflib_QueryFactory addQueryFactorySubselect(fflib_QueryFactory parentQueryFactory, String relationshipName, Boolean includeSelectorFields)
365+
{
366+
fflib_QueryFactory subSelectQueryFactory = parentQueryFactory.subselectQuery(relationshipName);
367+
return configureQueryFactory(subSelectQueryFactory, m_enforceCRUD, m_enforceFLS, includeSelectorFields);
368+
}
369+
353370
/**
354371
* Constructs the default SOQL query for this selector, see selectSObjectsById and queryLocatorById
355372
**/
@@ -415,4 +432,4 @@ public abstract with sharing class fflib_SObjectSelector
415432

416433
return queryFactory;
417434
}
418-
}
435+
}

0 commit comments

Comments
 (0)