Summer.Batch.Data.DbOperator Class Reference

Dedicated database operations. Most services that need to interact with a database should be using the methods exposed by this operator. More...

Public Member Functions

Query< T > (string query, IDictionary< string, object > parameters)
 Execute a query expected to return a single result. More...
 
Query< T > (string query, IQueryParameterSource parameterSource=null)
 Execute a query expected to return a single result. More...
 
Query< T > (ParsedQuery query, IQueryParameterSource parameterSource=null)
 Execute a query exepcted to return a single result. More...
 
void Select (string query, RowHandler rowHandler, IDictionary< string, object > parameters)
 Executes a select query using a DataAdapter. A row handler is run on each returned row. More...
 
IList< T > Select< T > (string query, RowMapper< T > mapper, IDictionary< string, object > parameters)
 Executes a select query using a DataAdapter and returns a list of objects using the provided row mapper. More...
 
IList< T > Select< T > (string query, RowMapper< T > mapper, IQueryParameterSource parameterSource)
 Executes a select query using a DataAdapter and returns data using the provided data reader extractor. More...
 
Select< T > (string query, DataReaderExtractor< T > extractor, IDictionary< string, object > parameters)
 Executes a select query using a DataAdapter and returns data using the provided data reader extractor. More...
 
Select< T > (string query, DataReaderExtractor< T > extractor, IQueryParameterSource parameterSource=null)
 Executes a select query using a DataAdapter and returns data using the provided data reader extractor. More...
 
Select< T > (ParsedQuery query, DataReaderExtractor< T > extractor, IQueryParameterSource parameterSource=null)
 Executes a select query using a DataAdapter and returns data using the provided data reader extractor. More...
 
DataSet Select (string query, IQueryParameterSource parameterSource=null)
 Executes a select query using a DbDataAdapter and returns a DataSet. More...
 
DataSet Select (ParsedQuery query, IQueryParameterSource parameterSource=null)
 Executes a select query using a DbDataAdapter and returns a DataSet. More...
 
int Update (string query, IDictionary< string, object > parameters)
 Executes an insert or update query on a database. More...
 
int Update (string query, IQueryParameterSource parameterSource=null)
 Executes an insert or update query on a database. More...
 
int Update (ParsedQuery query, IQueryParameterSource parameterSource=null)
 Executes an insert or update query on a database. More...
 
int[] BatchUpdate (string query, IList< IDictionary< string, object >> parameters)
 Executes an insert or update command multiple times. More...
 
int[] BatchUpdate (string query, IList< IQueryParameterSource > parameterSources)
 Executes an insert or update command multiple times. More...
 
int[] BatchUpdate (ParsedQuery query, IList< IQueryParameterSource > parameterSources)
 Executes an insert or update command multiple times. More...
 

Properties

IConnectionProvider ConnectionProvider [get, set]
 The IConnectionProvider to use to get the connections. More...
 

Detailed Description

Dedicated database operations. Most services that need to interact with a database should be using the methods exposed by this operator.

Member Function Documentation

int [] Summer.Batch.Data.DbOperator.BatchUpdate ( string  query,
IList< IDictionary< string, object >>  parameters 
)

Executes an insert or update command multiple times.

Parameters
querythe query to execute
parametersa list containing the parameters for each execution of the query
Returns
an array containing the affected rows for each execution
int [] Summer.Batch.Data.DbOperator.BatchUpdate ( string  query,
IList< IQueryParameterSource parameterSources 
)

Executes an insert or update command multiple times.

Parameters
querythe query to execute
parameterSourcesa list containing a IQueryParameterSource for each execution
Returns
an array containing the affected rows for each execution
int [] Summer.Batch.Data.DbOperator.BatchUpdate ( ParsedQuery  query,
IList< IQueryParameterSource parameterSources 
)

Executes an insert or update command multiple times.

Parameters
querythe parsed query to execute
parameterSourcesa list containing a IQueryParameterSource for each execution
Returns
an array containing the affected rows for each execution
T Summer.Batch.Data.DbOperator.Query< T > ( string  query,
IDictionary< string, object >  parameters 
)

Execute a query expected to return a single result.

Template Parameters
T the type of the result
Parameters
querythe SQL query
parametersthe parameters of the query
Returns
the result of the query
T Summer.Batch.Data.DbOperator.Query< T > ( string  query,
IQueryParameterSource  parameterSource = null 
)

Execute a query expected to return a single result.

Template Parameters
T the type of the result
Parameters
querythe SQL query
parameterSourcea parameter source that holds the parameter values for the query
Returns
the result of the query
T Summer.Batch.Data.DbOperator.Query< T > ( ParsedQuery  query,
IQueryParameterSource  parameterSource = null 
)

Execute a query exepcted to return a single result.

Template Parameters
T the type of the result
Parameters
querythe parsed query
parameterSourcea parameter source that holds the parameter values for the query
Returns
the result of the query
void Summer.Batch.Data.DbOperator.Select ( string  query,
RowHandler  rowHandler,
IDictionary< string, object >  parameters 
)

Executes a select query using a DataAdapter. A row handler is run on each returned row.

Parameters
querythe SQL query
rowHandlera mapper that will be executed on each returned row
parametersthe parameters of the query
DataSet Summer.Batch.Data.DbOperator.Select ( string  query,
IQueryParameterSource  parameterSource = null 
)

Executes a select query using a DbDataAdapter and returns a DataSet.

Parameters
querythe query
parameterSourcea parameter source that holds the parameter values for the query
Returns
a data set filled using the query
DataSet Summer.Batch.Data.DbOperator.Select ( ParsedQuery  query,
IQueryParameterSource  parameterSource = null 
)

Executes a select query using a DbDataAdapter and returns a DataSet.

Parameters
querythe parsed query
parameterSourcea parameter source that holds the parameter values for the query
Returns
a data set filled using the query
IList<T> Summer.Batch.Data.DbOperator.Select< T > ( string  query,
RowMapper< T >  mapper,
IDictionary< string, object >  parameters 
)

Executes a select query using a DataAdapter and returns a list of objects using the provided row mapper.

Template Parameters
T the type of the elements to return
Parameters
querythe SQL query
mapperthe row mapper responsible for creating the returned elements
parametersthe parameters of the query
Returns
a list of T elements obtained by executing the query
IList<T> Summer.Batch.Data.DbOperator.Select< T > ( string  query,
RowMapper< T >  mapper,
IQueryParameterSource  parameterSource 
)

Executes a select query using a DataAdapter and returns data using the provided data reader extractor.

Template Parameters
T the type of the elements to return
Parameters
querythe SQL query
mapperthe row mapper responsible for creating the returned elements
parameterSourcea parameter source that holds the parameter values for the query
Returns
a list of T elements obtained by executing the query
T Summer.Batch.Data.DbOperator.Select< T > ( string  query,
DataReaderExtractor< T >  extractor,
IDictionary< string, object >  parameters 
)

Executes a select query using a DataAdapter and returns data using the provided data reader extractor.

Template Parameters
T the type of the data to return
Parameters
querythe SQL query
extractorthe data reader mapper used to extract data
parametersthe parameters of the query
Returns
the extracted data
T Summer.Batch.Data.DbOperator.Select< T > ( string  query,
DataReaderExtractor< T >  extractor,
IQueryParameterSource  parameterSource = null 
)

Executes a select query using a DataAdapter and returns data using the provided data reader extractor.

Template Parameters
T the type of the data to return
Parameters
querythe SQL query
extractorthe data reader mapper used to extract data
parameterSourcea parameter source that holds the parameter values for the query
Returns
the extracted data
T Summer.Batch.Data.DbOperator.Select< T > ( ParsedQuery  query,
DataReaderExtractor< T >  extractor,
IQueryParameterSource  parameterSource = null 
)

Executes a select query using a DataAdapter and returns data using the provided data reader extractor.

Template Parameters
T the type of the data to return
Parameters
querythe parsed query
extractorthe data reader mapper used to extract data
parameterSourcea parameter source that holds the parameter values for the query
Returns
the extracted data
int Summer.Batch.Data.DbOperator.Update ( string  query,
IDictionary< string, object >  parameters 
)

Executes an insert or update query on a database.

Parameters
querythe query to execute
parametersthe parameters of the query
Returns
the number of affected rows
int Summer.Batch.Data.DbOperator.Update ( string  query,
IQueryParameterSource  parameterSource = null 
)

Executes an insert or update query on a database.

Parameters
querythe query to execute
parameterSourcea parameter source that holds the parameter values for the query
Returns
the number of affected rows
int Summer.Batch.Data.DbOperator.Update ( ParsedQuery  query,
IQueryParameterSource  parameterSource = null 
)

Executes an insert or update query on a database.

Parameters
querythe parsed query
parameterSourcea parameter source that holds the parameter values for the query
Returns
the number of affected rows

Property Documentation

IConnectionProvider Summer.Batch.Data.DbOperator.ConnectionProvider
getset

The IConnectionProvider to use to get the connections.


The documentation for this class was generated from the following file:
  • Summer.Batch.Data/DbOperator.cs