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.

Among the most important aspects of a mapper are:

There are several implementations of mappers that implement this interface and all of which derive from MapperKernel which implements all the common functionality:
  • 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.
In most cases you will want a TypedMapper for each mapper manipulated programmatically. A TypedMapper provides a type-safe implementation of a mapper based on its meta-data.

Remarks

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.

Remarks

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.

Namespace: NetQuarry.Data
Assembly: EAP.Core (in EAP.Core.dll) Version: 2.0.0.0 (4.5.2.0)

Syntax

C#
public interface IMapper : IDisposable
Visual Basic
Public Interface IMapper
	Inherits IDisposable

See Also