-
Book Overview & Buying
-
Table Of Contents
Force.com Enterprise Architecture - Second Edition
By :
The previous Selector usage example required a cast of the list returned to a list of Race__c objects, which is not ideal. To improve this, you can easily add a new method to the class to provide a more specific version of the base class method, as follows:
public List<Race__c> selectById(Set<Id>raceIds){
return (List<Race__c>) selectSObjectsById(raceIds);
}Thus, the usage code now looks like this:
List<Race__c> races = new RacesSelector().selectById(raceIds);
The fflib_SObjectSelector base class contains additional functionality to provide more query consistency and integration with the platform. These apply to the aforementioned selectSObjectsById method as well as your own. The following sections highlight each of these features.
You can, of course, extend the standard features of this base class further. Perhaps there is something you want all your queries to consider, a common...
Change the font size
Change margin width
Change background colour