Summer.Batch.Infrastructure.Item.Database.DataReaderItemReader< T > Class Template Reference

Implementation of T:IItemReader that reads items from a database using a DbDataReader. It creates its own connection as it will be busy until the reader is closed. More...

Inheritance diagram for Summer.Batch.Infrastructure.Item.Database.DataReaderItemReader< T >:
Summer.Batch.Infrastructure.Item.Support.AbstractItemCountingItemStreamItemReader< T > Summer.Batch.Common.Factory.IInitializationPostOperations Summer.Batch.Infrastructure.Item.Support.AbstractItemStreamItemReader< T > Summer.Batch.Infrastructure.Item.Util.ItemStreamSupport Summer.Batch.Infrastructure.Item.IItemStreamReader< T > Summer.Batch.Infrastructure.Item.IItemStream

Public Member Functions

 DataReaderItemReader ()
 Default constructor. More...
 
void AfterPropertiesSet ()
 See IInitializationPostOperations.AfterPropertiesSet. More...
 
- Public Member Functions inherited from Summer.Batch.Infrastructure.Item.Support.AbstractItemCountingItemStreamItemReader< T >
override T Read ()
 Reads a piece of input data and advance to the next one. Implementations must return null at the end of the input data set. In a transactional setting, caller might get the same item twice from successive calls (or otherwise), if the first call was in a transaction that rolled back. More...
 
override void Open (ExecutionContext executionContext)
 Open the stream for the provided ExecutionContext. More...
 
override void Close ()
 If any resources are needed for the stream to operate they need to be destroyed here. Once this method has been called all other methods (except open) may throw an exception. More...
 
override void Update (ExecutionContext executionContext)
 Indicates that the execution context provided during open is about to be saved. If any state is remaining, but has not been put in the context, it should be added here. More...
 
- Public Member Functions inherited from Summer.Batch.Infrastructure.Item.Util.ItemStreamSupport
virtual void Flush ()
 Flushes the stream. More...
 
string GetExecutionContextKey (string key)
 Transform the given key to use the name of this instance as prefix. More...
 
virtual void Dispose ()
 

Protected Member Functions

override void DoOpen ()
 Opens the stream. More...
 
override void DoClose ()
 Closes the stream. More...
 
override T DoRead ()
 Reads the next item from the data reader. More...
 
- Protected Member Functions inherited from Summer.Batch.Infrastructure.Item.Support.AbstractItemCountingItemStreamItemReader< T >
virtual void JumpToItem (int itemIndex)
 Move to the given item index. More...
 
- Protected Member Functions inherited from Summer.Batch.Infrastructure.Item.Util.ItemStreamSupport
virtual void Dispose (bool disposing)
 Does the actual dipose, delegating to Close(); More...
 

Properties

ConnectionStringSettings ConnectionString [get, set]
 A ConnectionString that holds the information on the connection to use More...
 
string Query [get, set]
 The sql query to execute for creating the data reader. More...
 
IQueryParameterSource ParameterSource [get, set]
 Source for the parameter values. More...
 
RowMapper< T > RowMapper [get, set]
 Mapper that creates the items from the data reader. More...
 
- Properties inherited from Summer.Batch.Infrastructure.Item.Support.AbstractItemCountingItemStreamItemReader< T >
int CurrentItemCount [protected get, set]
 The index of the item to start reading from. If the execution context contains a key [name].read.count (where [name] is the name of this component), the value from the execution context will be used instead. More...
 
int MaxItemCount [set]
 The maximum index of the items to be read. If the execution context contains a key [name].read.count.max (where [name] is the name of this component), the value from the execution context will be used instead. More...
 
bool SaveState [get, set]
 Flat that determines whether to save internal data in the execution context. Default value is true. Switch to false if you don't want to save any state from this stream or you don't want it to be restartable. More...
 
- Properties inherited from Summer.Batch.Infrastructure.Item.Util.ItemStreamSupport
string Name [set]
 The name of the component that will be used as prefix for keys in the execution context. More...
 

Detailed Description

Implementation of T:IItemReader that reads items from a database using a DbDataReader. It creates its own connection as it will be busy until the reader is closed.

Template Parameters
T the type of the read elements
Type Constraints
T :class 

Constructor & Destructor Documentation

Member Function Documentation

See IInitializationPostOperations.AfterPropertiesSet.

Implements Summer.Batch.Common.Factory.IInitializationPostOperations.

override T Summer.Batch.Infrastructure.Item.Database.DataReaderItemReader< T >.DoRead ( )
protectedvirtual

Reads the next item from the data reader.

Returns
the read item or null if there are no more results

Implements Summer.Batch.Infrastructure.Item.Support.AbstractItemCountingItemStreamItemReader< T >.

Property Documentation

ConnectionStringSettings Summer.Batch.Infrastructure.Item.Database.DataReaderItemReader< T >.ConnectionString
getset

A ConnectionString that holds the information on the connection to use

Source for the parameter values.

The sql query to execute for creating the data reader.

Mapper that creates the items from the data reader.


The documentation for this class was generated from the following file:
  • Summer.Batch.Infrastructure/Item/Database/DataReaderItemReader.cs