public void SetUp()
 {
     _mockery           = new MockRepository();
     _rowMapper         = _mockery.StrictMock <IRowCallback>();
     _rowMapperDelegate = _mockery.StrictMock <RowCallbackDelegate>();
     _dataReader        = _mockery.StrictMock <IDataReader>();
 }
コード例 #2
0
 public void SetUp()
 {
     _mockery             = new MockRepository();
     _adoOperations       = _mockery.StrictMock <IAdoOperations>();
     _ordinalCache        = _mockery.StrictMock <IDataRecordOrdinalCache>();
     _rowCallback         = _mockery.StrictMock <IRowCallback>();
     _rowCallbackDelegate = _mockery.StrictMock <RowCallbackDelegate>();
 }
コード例 #3
0
 private static IResultSetExtractor MakeResultSetExtractor(
     RowCallbackDelegate rowCallbackDelegate, IDataRecordOrdinalCache ordinalCache, int rowsExpected)
 {
     return(new ExtendedRowCallbackResultSetExtractor(rowCallbackDelegate)
     {
         OrdinalCache = ordinalCache,
         RowsExpected = rowsExpected
     });
 }
コード例 #4
0
ファイル: TWQDMerge.cs プロジェクト: hkbadeq/opennode2-dotnet
 private void DoSimpleQueryWithRowCallbackDelegate(IDbCommand dbCommand, string semicolonSeparatedTableNames,
                                                   string semicolonSeparatedWhereColumnNames,
                                                   IList <object> whereValues,
                                                   string semicolonSeparatedColumnNames,
                                                   RowCallbackDelegate callback)
 {
     _dao.DoSimpleQueryWithRowCallbackDelegate(semicolonSeparatedTableNames, semicolonSeparatedWhereColumnNames, whereValues,
                                               semicolonSeparatedColumnNames, callback);
 }
コード例 #5
0
        /// <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);
        }
コード例 #6
0
        /// <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);
        }
コード例 #7
0
ファイル: AdoTemplate.cs プロジェクト: Binodesk/spring-net
        public virtual void QueryWithRowCallbackDelegate(CommandType cmdType, string sql, RowCallbackDelegate rowCallbackDelegate, IDbParameters parameters)
        {
            QueryWithResultSetExtractor(cmdType, sql, new RowCallbackResultSetExtractor(rowCallbackDelegate), parameters);

        }
コード例 #8
0
ファイル: AdoTemplate.cs プロジェクト: Binodesk/spring-net
        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);

        }
コード例 #9
0
ファイル: AdoTemplate.cs プロジェクト: Binodesk/spring-net
        public virtual void QueryWithRowCallbackDelegate(CommandType cmdType, string sql, RowCallbackDelegate rowCallbackDelegate, ICommandSetter commandSetter)
        {
            QueryWithResultSetExtractor(cmdType, sql, new RowCallbackResultSetExtractor(rowCallbackDelegate), commandSetter);

        }
コード例 #10
0
 /// <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;
 }
コード例 #11
0
 /// <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;
 }