New implementation centered around SObjectRepository.cls
Pre-release
Pre-release
Refactored again - core logic lives in the abstract class SObjectRepository & interface ISObjectRepository
- SObjectRepository uses field sets in the constructor and has several protected builder methods. These are used to give a structured method of building a query string
- Class constructors can be overloaded to allow a field set to passed in
- By default, some the common query fields are automatically added to the query. This includes audit fields (created by ID/created date, etc), name/subject fields, and a few other similar fields. A boolean can be passed to disable this
- Any queries needed in your codebase should be packaged as public methods. These should call any private/protected builder methods and return the results of the query, casted to the appropriate data type
- Two example concrete classes are included - LeadRepository.cls & TaskRepository.cls
- Two utils classes, CollectionUtils & StringUtils, are also included