C# Class Adf.Base.Data.DictionaryQueryHandler

Repesents a service handler that is dependent to the use of DictionaryState for database tranaction. Provides the actual database handling for Select, Delete, Insert and Update data. Uses a timestamp to check for concurrency. Warning: @@DBTS is used to get the new timestamp after insert or update. Be aware that this works only in the current database, so a view to a diffentent database is not supported!
Inheritance: IAdfQueryHandler
ファイルを表示 Open project: NLADP/ADF

Public Methods

Method Description
Delete ( IAdfQuery query ) : int
New ( IAdfQuery query ) : IInternalState

Create a new data row of IInternalState to insert new data into database.

Run ( IAdfQuery query ) : IInternalState

Executes a specified IAdfQuery statement and returns the affected row of data.

RunAndSplit ( IAdfQuery query ) : IEnumerable

Executes the specified query and return the result, where each row in the result is stored in an instance of IInternalState.

RunScalar ( IAdfQuery query ) : object

Executes the IAdfQuery, and returns the first column of the first row in the resultset returned by the IAdfQuery. Extra columns or rows are ignored.

Save ( IAdfQuery query, IInternalState data ) : bool

Save the specified data of IInternalState into database.

Protected Methods

Method Description
RunSave ( DictionaryState state, IAdfQuery query ) : bool

Executes a query

Private Methods

Method Description
CreateState ( ColumnDescriber>.Dictionary describers, System.Data.SqlClient.SqlDataReader reader = null ) : IInternalState
GetSchema ( IAdfQuery query, System.Data.SqlClient.SqlDataReader reader = null ) : ColumnDescriber>.Dictionary
RunQuery ( IAdfQuery query ) : IEnumerable

Runs the specified IAdfQuery.

Method Details

Delete() public method

public Delete ( IAdfQuery query ) : int
query IAdfQuery
return int

New() public method

Create a new data row of IInternalState to insert new data into database.
public New ( IAdfQuery query ) : IInternalState
query IAdfQuery The that defines the datasource name and query statement.
return IInternalState

Run() public method

Executes a specified IAdfQuery statement and returns the affected row of data.
public Run ( IAdfQuery query ) : IInternalState
query IAdfQuery The that defines the datasource name and query statement.
return IInternalState

RunAndSplit() public method

Executes the specified query and return the result, where each row in the result is stored in an instance of IInternalState.
public RunAndSplit ( IAdfQuery query ) : IEnumerable
query IAdfQuery The that defines the datasource name and query statement.
return IEnumerable

RunSave() protected method

Executes a query
protected RunSave ( DictionaryState state, IAdfQuery query ) : bool
state DictionaryState
query IAdfQuery
return bool

RunScalar() public method

Executes the IAdfQuery, and returns the first column of the first row in the resultset returned by the IAdfQuery. Extra columns or rows are ignored.
The current state of the connection is closed.
public RunScalar ( IAdfQuery query ) : object
query IAdfQuery The that defines the datasource name and query statement.
return object

Save() public method

Save the specified data of IInternalState into database.
The current state of the connection is closed. An attempt to execute an INSERT, UPDATE, or DELETE statement resulted in zero records affected.
public Save ( IAdfQuery query, IInternalState data ) : bool
query IAdfQuery The that defines the datasource name and query statement.
data IInternalState The data of that needs to be saved.
return bool