SOSL and aggregate SOQL queries

SOQL is not the only way to query information from the database. Lightning Platform also provides a powerful Salesforce Object Search Language (SOSL) facility. Like SOQL, this returns SObjects. While this chapter has not covered this variation in depth, the use of Selector methods to encapsulate SOSL is appropriate and, in fact, provides a good abstraction from the caller, allowing the developer of the Selector to use either SOQL or SOSL in future without impacting the callers.

Likewise, Aggregate SOQL queries are also good candidates to encapsulate in Selector methods. However, in these cases, consider using Apex native data types (for example, a list of values) or lists of custom Apex data types to expose the aggregate information.

The consolidated source code for this book, available in the master branch of the GitHub repository, contains a RaceDataSelector class. Within this class is a custom Selector method, selectAnalysisGroupByRaceName, that demonstrates the use of a SOQL aggregate query.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.171.136