Advertisement
Learnify_Rectify

Apply Selector Layer Principles in Apex

May 18th, 2025 (edited)
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | Source Code | 0 0
  1. Apply Selector Layer Principles in Apex
  2. ------------------------------------------------------------------------------------------------
  3. class name: AccountsSelector
  4.  
  5. public class AccountsSelector extends fflib_SObjectSelector {
  6. public List<Schema.SObjectField> getSObjectFieldList() {
  7. return new List<Schema.SObjectField> {
  8. Account.Name,
  9. Account.Description,
  10. Account.AnnualRevenue};
  11. }
  12. public Schema.SObjectType getSObjectType() {
  13. return Account.sObjectType;
  14. }
  15. public List<Account> selectById(Set<ID> idSet) {
  16. return (List<Account>) selectSObjectsById(idSet);
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement