We have been using FF library for Separation of Concerns framework and it is working great. We need to add subquery to it, but running into issues. Example I am following is from this article: https://quirkyapex.com/2016/08/18/fflib-selector-layer/
public class OpportunityLineItemsSelector extends fflib_SObjectSelector {
public Schema.SObjectType getSObjectType(){
return OpportunityLineItem.sObjectType;
}
public override List<Schema.SObjectField> getSObjectFieldList(){
return new List<Schema.SObjectField> {
OpportunityLineItem.Id,
OpportunityLineItem.Quantity,
OpportunityLineItem.SalesPrice
};
}
}
public class OpportunitiesSelector extends fflib_SObjectSelector {
public Schema.SObjectType getSObjectType(){
return Opportunity.sObjectType;
}
public override List<Schema.SObjectField> getSObjectFieldList(){
return new List<Schema.SObjectField> {
Opportunity.Id,
Opportunity.StageName
};
}
public List<Opportunity> selectByIdWithLineItems(Set<Id> recordIds){
fflib_QueryFactory query = newQueryFactory();
query.setCondition('Id IN :recordIds');
query.addQueryFactorySubselect(
new OpportunityLineItemsSelector().newQueryFactory()
);
return (List<Opportunity>) Database.query( query.toSOQL() );
}
}
I get compile error:
Method does not exist or incorrect signature: void addQueryFactorySubselect(fflib_QueryFactory) from the type fflib_QueryFactory at line 17 column 13
Below method does exist in "ev_SObjectSelector""fflib_SObjectSelector" class
global fflib__QueryFactoryfflib_QueryFactory addQueryFactorySubselect(fflib__QueryFactoryfflib_QueryFactory parentQueryFactory)
{
return addQueryFactorySubselect(parentQueryFactory, true);
}
What am I missing here?