I'm working on a skipe for this fflib and I'm facing this error when I try to execute a Cross-Object or Sub-Select query:.
|WARN|fflib_QueryFactory.subselectQuery(Schema.SObjectType) is deprecated and will be removed in a future release. Use fflib_QueryFactory.subselectQuery(String) or fflib_QueryFactory.subselectQuery(ChildRelationship) instead.
I'm basically following the Trailhead: Apex Enterprise Patterns: Domain & Selector Layers.
On the last section of this module, Apply Selector Layer Principles in Apex there is a part explaining how to reuse field list: Advanced: Reusing Field Lists for Cross-Object and Sub-Select Queries
public List<Opportunity> selectByIdWithProducts(Set<ID> idSet) {
// Query Factory for this Selector (Opportunity)
fflib_QueryFactory opportunitiesQueryFactory = newQueryFactory();
// Add a query sub-select via the Query Factory for the Opportunity Products
fflib_QueryFactory lineItemsQueryFactory =
new OpportunityLineItemsSelector().
addQueryFactorySubselect(opportunitiesQueryFactory);
// Add cross object query fields for Pricebook Entry, Products and Pricebook
new PricebookEntriesSelector().
configureQueryFactoryFields(lineItemsQueryFactory, 'PricebookEntry');
new ProductsSelector().
configureQueryFactoryFields(lineItemsQueryFactory, 'PricebookEntry.Product2');
new PricebooksSelector().
configureQueryFactoryFields(lineItemsQueryFactory, 'PricebookEntry.Pricebook2');
// Set the condition and build the query
return (List<Opportunity>) Database.query(
opportunitiesQueryFactory.setCondition('id in :idSet').toSOQL());
}
When executing this method I get the error mentioned on the top of this question. I have tried several things but I still get the same error. All the test code is updated from classes on this repository. Anyone has ever faced similar issue with this library?