public void SetUp() { _mockery = new MockRepository(); _rowMapper = _mockery.StrictMock <IRowCallback>(); _rowMapperDelegate = _mockery.StrictMock <RowCallbackDelegate>(); _dataReader = _mockery.StrictMock <IDataReader>(); }
public void SetUp() { _mockery = new MockRepository(); _adoOperations = _mockery.StrictMock <IAdoOperations>(); _ordinalCache = _mockery.StrictMock <IDataRecordOrdinalCache>(); _rowCallback = _mockery.StrictMock <IRowCallback>(); _rowCallbackDelegate = _mockery.StrictMock <RowCallbackDelegate>(); }
private static IResultSetExtractor MakeResultSetExtractor( RowCallbackDelegate rowCallbackDelegate, IDataRecordOrdinalCache ordinalCache, int rowsExpected) { return(new ExtendedRowCallbackResultSetExtractor(rowCallbackDelegate) { OrdinalCache = ordinalCache, RowsExpected = rowsExpected }); }
private void DoSimpleQueryWithRowCallbackDelegate(IDbCommand dbCommand, string semicolonSeparatedTableNames, string semicolonSeparatedWhereColumnNames, IList <object> whereValues, string semicolonSeparatedColumnNames, RowCallbackDelegate callback) { _dao.DoSimpleQueryWithRowCallbackDelegate(semicolonSeparatedTableNames, semicolonSeparatedWhereColumnNames, whereValues, semicolonSeparatedColumnNames, callback); }
/// <summary> /// Query database with given SQL command and have each row processed /// by a given <see cref="RowCallbackDelegate"/> with help of optional /// ordinal cache and/or the rows expected value for better performance. /// </summary> /// /// <param name="operations"> /// An <see cref="Spring.Data.Generic.IAdoOperations"/> object to /// perform database operation. /// </param> /// <param name="cmdType"> /// The type of command. /// </param> /// <param name="cmdText"> /// The text of command. /// </param> /// <param name="rowCallbackDelegate"> /// The row callback delegate that processes each row. /// </param> /// <param name="ordinalCache"> /// The <see cref="IDataRecordOrdinalCache"/> that caches the mapping /// from field name to field index. /// </param> /// <param name="rowsExpected"> /// Number of rows this query is expected to return. This doesn't need /// to be accurate but estimating at the higer end for best performance. /// </param> public static void QueryWithRowCallbackDelegate( this IAdoOperations operations, CommandType cmdType, string cmdText, RowCallbackDelegate rowCallbackDelegate, IDataRecordOrdinalCache ordinalCache, int rowsExpected) { var extractor = MakeResultSetExtractor(rowCallbackDelegate, ordinalCache, rowsExpected); operations.QueryWithResultSetExtractor(cmdType, cmdText, extractor); }
/// <summary> /// Query database with given SQL command and have each row processed /// by a given <see cref="RowCallbackDelegate"/> with help of optional /// ordinal cache and/or the rows expected value for better performance. /// </summary> /// /// <param name="operations"> /// An <see cref="Spring.Data.Generic.IAdoOperations"/> object to /// perform database operation. /// </param> /// <param name="cmdType"> /// The type of command. /// </param> /// <param name="cmdText"> /// The text of command. /// </param> /// <param name="rowCallbackDelegate"> /// The row callback delegate that processes each row. /// </param> /// <param name="parameterValue"> /// The value of the parameter. /// </param> /// <param name="ordinalCache"> /// The <see cref="IDataRecordOrdinalCache"/> that caches the mapping /// from field name to field index. /// </param> /// <param name="parameterName"> /// The name of the parameter. /// </param> /// <param name="rowsExpected"> /// Number of rows this query is expected to return. This doesn't need /// to be accurate but estimating at the higer end for best performance. /// </param> /// <param name="dbType"> /// Type type of the parameter. /// </param> /// <param name="size"> /// The size of parameter. /// </param> public static void QueryWithRowCallbackDelegate( this IAdoOperations operations, CommandType cmdType, string cmdText, RowCallbackDelegate rowCallbackDelegate, string parameterName, Enum dbType, int size, object parameterValue, IDataRecordOrdinalCache ordinalCache, int rowsExpected) { var extractor = MakeResultSetExtractor(rowCallbackDelegate, ordinalCache, rowsExpected); operations.QueryWithResultSetExtractor( cmdType, cmdText, extractor, parameterName, dbType, size, parameterValue); }
public virtual void QueryWithRowCallbackDelegate(CommandType cmdType, string sql, RowCallbackDelegate rowCallbackDelegate, IDbParameters parameters) { QueryWithResultSetExtractor(cmdType, sql, new RowCallbackResultSetExtractor(rowCallbackDelegate), parameters); }
public virtual void QueryWithRowCallbackDelegate(CommandType cmdType, string sql, RowCallbackDelegate rowCallbackDelegate, string name, Enum dbType, int size, object parameterValue) { QueryWithResultSetExtractor(cmdType, sql, new RowCallbackResultSetExtractor(rowCallbackDelegate), name, dbType, size, parameterValue); }
public virtual void QueryWithRowCallbackDelegate(CommandType cmdType, string sql, RowCallbackDelegate rowCallbackDelegate, ICommandSetter commandSetter) { QueryWithResultSetExtractor(cmdType, sql, new RowCallbackResultSetExtractor(rowCallbackDelegate), commandSetter); }
/// <summary> /// Initializes a new instance of the <see cref="RowCallbackResultSetExtractor"/> class. /// </summary> /// <param name="rowCallbackDelegate">The row callback delegate.</param> public RowCallbackResultSetExtractor(RowCallbackDelegate rowCallbackDelegate) { AssertUtils.ArgumentNotNull(rowCallbackDelegate, "rowCallbackDelegate"); this.rowCallbackDelegate = rowCallbackDelegate; }