示例#1
0
 public AS400SequenceValueGeneratorFactory(
     [NotNull] IRawSqlCommandBuilder rawSqlCommandBuilder,
     [NotNull] IAS400UpdateSqlGenerator sqlGenerator)
 {
     Check.NotNull(rawSqlCommandBuilder, nameof(rawSqlCommandBuilder));
     Check.NotNull(sqlGenerator, nameof(sqlGenerator));
     _rawSqlCommandBuilder = rawSqlCommandBuilder;
     _sqlGenerator         = sqlGenerator;
 }
        public AS400SequenceHiLoValueGenerator(
            [NotNull] IRawSqlCommandBuilder rawSqlCommandBuilder,
            [NotNull] IAS400UpdateSqlGenerator sqlGenerator,
            [NotNull] AS400SequenceValueGeneratorState generatorState,
            [NotNull] IAS400RelationalConnection connection)
            : base(generatorState)
        {
            Check.NotNull(rawSqlCommandBuilder, nameof(rawSqlCommandBuilder));
            Check.NotNull(sqlGenerator, nameof(sqlGenerator));
            Check.NotNull(connection, nameof(connection));

            _sequence             = generatorState.Sequence;
            _rawSqlCommandBuilder = rawSqlCommandBuilder;
            _sqlGenerator         = sqlGenerator;
            _connection           = connection;
        }
示例#3
0
 public AS400ModificationCommandBatch(
     [NotNull] IRelationalCommandBuilderFactory commandBuilderFactory,
     [NotNull] ISqlGenerationHelper sqlGenerationHelper,
     [NotNull] IAS400UpdateSqlGenerator updateSqlGenerator,
     [NotNull] IRelationalValueBufferFactoryFactory valueBufferFactoryFactory,
     [NotNull] IRelationalConnection connection, //TODO: GetRidOf?
     [CanBeNull] int?maxBatchSize
     ) : base(
         commandBuilderFactory,
         sqlGenerationHelper,
         updateSqlGenerator,
         valueBufferFactoryFactory
         )
 {
     if (maxBatchSize.HasValue && maxBatchSize.Value <= 0)
     {
         throw new ArgumentOutOfRangeException(nameof(maxBatchSize), RelationalStrings.InvalidMaxBatchSize);
     }
     _connection   = connection;
     _maxBatchSize = Math.Min(maxBatchSize ?? int.MaxValue, MaxRowCount);
 }
示例#4
0
        public AS400ModificationCommandBatchFactory(
            [NotNull] IRelationalCommandBuilderFactory commandBuilderFactory,
            [NotNull] ISqlGenerationHelper sqlGenerationHelper,
            [NotNull] IAS400UpdateSqlGenerator updateSqlGenerator,
            [NotNull] IRelationalValueBufferFactoryFactory valueBufferFactoryFactory,
            [NotNull] IDbContextOptions options,
            [NotNull] IRelationalConnection connection)
        {
            Check.NotNull(commandBuilderFactory, nameof(commandBuilderFactory));
            Check.NotNull(sqlGenerationHelper, nameof(sqlGenerationHelper));
            Check.NotNull(updateSqlGenerator, nameof(updateSqlGenerator));
            Check.NotNull(valueBufferFactoryFactory, nameof(valueBufferFactoryFactory));
            Check.NotNull(options, nameof(options));
            Check.NotNull(connection, nameof(connection));

            _commandBuilderFactory     = commandBuilderFactory;
            _sqlGenerationHelper       = sqlGenerationHelper;
            _updateSqlGenerator        = updateSqlGenerator;
            _valueBufferFactoryFactory = valueBufferFactoryFactory;
            _options    = options;
            _connection = connection;
        }