fferpcore.DataSourceBaseglobal with sharing abstract class DataSourceBase extends DataSource Base support for DataSource, specifically handling relations. This class extends fferpcore.DataSource Methods
DataSourceBaseglobal DataSourceBase(SObjectType objectType) Input Parameters
getSObjectTypeglobal virtual SObjectType getSObjectType() Return ValueThe object type that this data source queries. requireLookupFieldglobal virtual override fferpcore.DataSource requireLookupField(SObjectField field) Implements requireLookupField from the fferpcore.DataSource interface. Input Parameters
Sample Code
requireLookupFieldglobal virtual override fferpcore.DataSource requireLookupField(String fieldName) Implements requireLookupField from the fferpcore.DataSource interface. Input Parameters
Sample Code
requireOneToManyFieldglobal virtual override fferpcore.DataSource requireOneToManyField(fferpcore.DataSource.BackReference backReference) Implements requireOneToManyField from the fferpcore.DataSource interface. Input Parameters
Return ValueAn fferpcore.DataSource for the related records. Sample Code
requireFieldglobal virtual override void requireField(String fieldName) Implementation of requireField which parses the supplied fieldName using parseFieldName(). runQueryglobal virtual override Iterator<fferpcore.DataSource.Row> runQuery() Implements runQuery from the fferpcore.DataSource interface. Return ValueAn instance of fferpcore.DataSource.Row objects. Sample Code
parseFieldNameglobal virtual SObjectField parseFieldName(String spec) Determines the object field from the field specification provided. Input Parameters
fferpcore.DataSourceBase.RelatedDataSourceglobal interface RelatedDataSource Contract with data sources created for lookups. DataSources may implement this interface directly, or an Adapter Pattern may be used to connect the related DataSource. Methods
asDataSourceDataSource asDataSource() Return this datasource as an instance of DataSource. In most cases implementors will implement both interfaces and return themselves from this method, though the returned fferpcore.DataSource does not have to be the same instance as the RelatedDataSource. runLookupQueryRelatedQueryResult runLookupQuery(SObjectField lookupField, fferpcore.DataSourceBase.DirectQueryResult source) Perform the query given the set of foreign keys from the parent DataSource. Input Parameters
fferpcore.DataSourceBase.RelatedQueryResultglobal interface RelatedQueryResult The result from calling runLookupQuery on a RelatedDataSource. MethodsgetRelatedRowDataSource.Row getRelatedRow(SObjectField lookupField, fferpcore.DataSource.Row parentRow) Return the row corresponding to the given key. Input Parameters
Sample Code
fferpcore.DataSourceBase.OneToManyRelatedDataSourceglobal interface OneToManyRelatedDataSource Contract with data sources acting as one-to-many relationships with this DataSource. DataSources may implement this interface directly, or an Adapter Pattern may be used to connect the related DataSource. Methods
asDataSourceDataSource asDataSource() Return this datasource as an instance of DataSource. In most cases implementors will implement both interfaces and return themselves from this method, though the returned fferpcore.DataSource does not have to be the same instance as the OneToManyRelatedDataSource. runOneToManyQueryOneToManyQueryResult runOneToManyQuery(fferpcore.DataSource.BackReference backReference, fferpcore.DataSourceBase.DirectQueryResult parentSource) Perform the query given the set of foreign keys from the parent DataSource. Input Parameters
fferpcore.DataSourceBase.OneToManyQueryResultglobal interface OneToManyQueryResult Query result from an OneToManyRelatedDataSource. MethodsgetOneToManyResultIterator<DataSource.Row> getOneToManyResult(fferpcore.DataSource.BackReference backReference, fferpcore.DataSource.Row masterRow) Return the rows corresponding to the given BackReference on the given Master Row. Input Parameters
Sample Code
fferpcore.DataSourceBase.DirectQueryResultglobal interface DirectQueryResult Means by which the queryRelatedDataSources method can access keys to query by. MethodsgetPrimaryKeysSet<Id> getPrimaryKeys() Used by the default implementation of OneToManyRelatedDataSource to find the set of what to it are foreign keys to look up. Return ValueThe set of primary keys for all records in this source not including null. These are the foreign keys in the one to many related DataSource. getKeysForFieldSet<Id> getKeysForField(SObjectField field) Used by the default implementation of RelatedDataSource to find the set of keys to query for. Input Parameters
Return ValueThe set of keys, not including null, for the given field. fferpcore.DataSourceBase.SimpleDirectQueryResultglobal inherited sharing class SimpleDirectQueryResult implements DirectQueryResult An implementation of DirectQueryResult encapsulates a list of SObject records. This class implements the following interfaces: Methods
SimpleDirectQueryResultglobal SimpleDirectQueryResult(List<SObject> records) Input Parameters
getRecordsglobal List<SObject> getRecords() Return ValueThe list of records in this result. Sample Code
getPrimaryKeysglobal Set<Id> getPrimaryKeys() Return ValueThe set of IDs, not including null, for all records in this source. Sample Code
getKeysForFieldglobal Set<Id> getKeysForField(SObjectField field) Input Parameters
Return ValueThe set of keys, not including null, for the given field. Sample Code
fferpcore.DataSourceBase.Rowglobal inherited sharing class Row extends DataSource.Row Implementation of the fferpcore.DataSource.Row abstract class. Represents the result of reading a Row from the database. This class extends fferpcore.DataSource.Row Methods
Rowglobal Row(SObject record, Map<SObjectField, fferpcore.DataSourceBase.RelatedQueryResult> relatedResults, Map<fferpcore.DataSource.BackReference, fferpcore.DataSourceBase.OneToManyQueryResult> oneToManyResults) Input Parameters
getFieldValueglobal override Object getFieldValue(SObjectField field) Implementation of getFieldValue(field) on DataSource.Row. Input Parameters
Return ValueThe value of the requested field. May give an exception if the field was not queried. Sample Code
getFieldValueglobal virtual override Object getFieldValue(String fieldName) Implementation of getFieldValue(field) on DataSource.Row. Input Parameters
Return ValueThe value of the requested field. An exception might occur if the field was not queried. Sample Code
getRelationglobal override fferpcore.DataSource.Row getRelation(SObjectField field) Implementation of getRelation(field) on DataSource.Row. Input Parameters
Return ValueThe DataSource.Row that represents the given relation. Returns null if the relation is missing or was not queried. Sample Code
getRelationglobal virtual override fferpcore.DataSource.Row getRelation(String fieldName) Implementation of getRelation(fieldName) on DataSource.Row. Input Parameters
Return ValueThe DataSource.Row that represents the given relation. Returns null if the relation is missing or was not queried. getOneToManyglobal override Iterator<fferpcore.DataSource.Row> getOneToMany(fferpcore.DataSource.BackReference backRef) Implementation of getOneToMany(backRef) on DataSource.Row. Return an Iterator of fferpcore.DataSource.Row that represent the given one to many relationship. Returns an empty Iterator if the relationship has no related Rows or was not queried. Input Parameters
Return ValueAn iterator of Row objects. Sample Code
parseFieldNameglobal virtual SObjectField parseFieldName(String spec) Determines the contract for the string based field accessor methods. Accepts either a single field name or the combination objectType.fieldName as used by the fferpcore.Path class. |