A Mapper is the primary means of mapping object-oriented programming objects to data sources managed by relational databases or other sources of data. A Mapper provides 2-way (Read and Write) access to the underlying Data Source.Namespace: NetQuarry.Data
Among the most important aspects of a mapper are:
- A mapper contains a collection of IField objects in its Fields collection.
- A set of MapperAttrs provide high-level control over mapper behaviour.
- A mapper fires ExtensionEvents to MapperExtensionKernel extensions in its Extensions collection in descending Priority order.
- A mapper provides for record movement via methods such as MoveNext()()()() and MoveNew()()()().
- A mapper accesses its data source using an IDatabase object.
- A mapper is used to perform CRUD operations using Save()()()() to insert/update records and Delete()()()() to delete records.
- The mapper's Exec(MapperExecCmds, Int32, array<Object>()) method exposes additional functionality via MapperExecCmds.
- Mapper - Basic mapper intended for programmatic use (with no UI).
- MapperList - Basic list mapper intended for programmatic use (with no UI).
- MapperDetail - Standard editable single-item detail UI mapper.
- MapperDatasheet - Standard list UI mapper.
By default a mapper is forward-only and uses an ADO DataReader for efficent cursor-based access to large sets of data. Set the BiDirectional attribute to cause the mapper to read the queried data into an internal DataTable and provide forward and backward movement.
Typically a mapper query is performed against a table or view, however, it is possible to configure a mapper to use a Stored Procedure as the source for its data by setting the mapper's QuerySQL property. When specified, QuerySQL will override the mapper's View (which, though ignored, must still be specified) when the mapper queries for its data during Requery(RequeryHints). A typical Stored Procedure QuerySQL looks like:
spMyData [[PREFILTER]], [[FILTER]], [[OPTIONS]], [[SORT]], [[TOPN]], <params>.Stored Procedure parameters may be passed in any order, are resolved for embedded functions using the EmbeddedParser, and may optionally include any or all of these predefined parameter markers that will be replaced by the mapper when the Stored Procedure is called. Note that all markers are case-sensitive.
- [[PREFILTER]] - The SQL WHERE clause (without "WHERE"), constructed by the mapper, to be applied to the intermediate Stored Procedure result. Only those MapperFilter items in the mapper's MapperFilters collection marked with PreFilter will be included in this clause. Typically a MapperFilter is marked as PreFilter because is was generated from a IField marked as PreFilter (e.g. from the FBF).
- [[FILTER]] - The SQL WHERE clause (without "WHERE"), constructed by the mapper, to be applied to the final Stored Procedure result. Only those MapperFilter items in the mapper's MapperFilters collection not marked with PreFilter will be included in this clause.
- [[OPTIONS]] - Options from QuerySqlOptions telling the Stored Procedure what kind of data to return.
- [[SORT]] - The SQL ORDER BY clause (without "ORDER BY") constructed by the mapper.
- [[TOPN]] - The TOP(N) clause specifying that only the first N records should be returned.
Assembly: EAP.Core (in EAP.Core.dll) Version: 22.214.171.124 (126.96.36.199)
public interface IMapper : IDisposable
Public Interface IMapper Inherits IDisposable