Exemplo n.º 1
0
        public override IJoinSourceQueryBuilder <TRecord> Join(IAliasedSelectSource source, JoinType joinType, CommandParameterValues parameterValues, Parameters parameters, ParameterDefaults parameterDefaults)
        {
            if (clauses.Count == 0)
            {
                throw new InvalidOperationException("Must have at least one 'ON' clause per join");
            }

            intermediateJoins.Add(new Join(clauses.ToList(), joinSource, type));
            clauses    = new List <JoinClause>();
            joinSource = source;
            type       = joinType;

            var commandParameterValues    = new CommandParameterValues(ParamValues, parameterValues);
            var combinedParameters        = new Parameters(Params, parameters);
            var combinedParameterDefaults = new ParameterDefaults(ParamDefaults, parameterDefaults);

            ParamValues.Clear();
            ParamValues.AddRange(commandParameterValues);
            Params.Clear();
            Params.AddRange(combinedParameters);
            ParamDefaults.Clear();
            ParamDefaults.AddRange(combinedParameterDefaults);

            return(this);
        }
Exemplo n.º 2
0
 public void AddRange(ParameterDefaults defaults)
 {
     foreach (var def in defaults)
     {
         Add(def);
     }
 }
Exemplo n.º 3
0
 public SubquerySourceBuilder(ISelect select,
                              IRelationalTransaction relationalTransaction,
                              ITableAliasGenerator tableAliasGenerator,
                              IUniqueParameterNameGenerator uniqueParameterNameGenerator,
                              CommandParameterValues parameterValues,
                              Parameters parameters,
                              ParameterDefaults parameterDefaults)
     : base(relationalTransaction, tableAliasGenerator, uniqueParameterNameGenerator, parameterValues, parameters, parameterDefaults)
 {
     this.select = select;
 }
Exemplo n.º 4
0
 public TableSourceQueryBuilder(string tableOrViewName,
                                IRelationalTransaction relationalTransaction,
                                ITableAliasGenerator tableAliasGenerator,
                                IUniqueParameterNameGenerator uniqueParameterNameGenerator,
                                CommandParameterValues parameterValues,
                                Parameters parameters,
                                ParameterDefaults parameterDefaults)
     : base(relationalTransaction, tableAliasGenerator, uniqueParameterNameGenerator, parameterValues, parameters, parameterDefaults)
 {
     this.tableOrViewName = tableOrViewName;
 }
Exemplo n.º 5
0
 protected SourceQueryBuilder(IRelationalTransaction relationalTransaction,
                              ITableAliasGenerator tableAliasGenerator,
                              IUniqueParameterNameGenerator uniqueParameterNameGenerator,
                              CommandParameterValues parameterValues,
                              Parameters parameters,
                              ParameterDefaults parameterDefaults)
 {
     RelationalTransaction        = relationalTransaction;
     TableAliasGenerator          = tableAliasGenerator;
     UniqueParameterNameGenerator = uniqueParameterNameGenerator;
     ParamValues   = parameterValues;
     Params        = parameters;
     ParamDefaults = parameterDefaults;
 }
Exemplo n.º 6
0
 public QueryBuilder(TSelectBuilder selectBuilder,
                     IRelationalTransaction transaction,
                     ITableAliasGenerator tableAliasGenerator,
                     IUniqueParameterNameGenerator uniqueParameterNameGenerator,
                     CommandParameterValues paramValues,
                     Parameters @params,
                     ParameterDefaults paramDefaults)
 {
     this.selectBuilder                = selectBuilder;
     this.transaction                  = transaction;
     this.tableAliasGenerator          = tableAliasGenerator;
     this.uniqueParameterNameGenerator = uniqueParameterNameGenerator;
     this.paramValues                  = paramValues;
     this.@params       = @params;
     this.paramDefaults = paramDefaults;
 }
Exemplo n.º 7
0
 public JoinSourceQueryBuilder(IAliasedSelectSource originalSource,
                               JoinType joinType,
                               IAliasedSelectSource nextJoin,
                               IRelationalTransaction relationalTransaction,
                               ITableAliasGenerator tableAliasGenerator,
                               IUniqueParameterNameGenerator uniqueParameterNameGenerator,
                               CommandParameterValues parameterValues,
                               Parameters parameters,
                               ParameterDefaults parameterDefaults)
     : base(relationalTransaction, tableAliasGenerator, uniqueParameterNameGenerator, parameterValues, parameters, parameterDefaults)
 {
     this.originalSource = originalSource;
     clauses             = new List <JoinClause>();
     joinSource          = nextJoin;
     type = joinType;
 }
Exemplo n.º 8
0
        public IJoinSourceQueryBuilder <TRecord> Join(IAliasedSelectSource source, JoinType joinType, CommandParameterValues parameterValues, Parameters parameters, ParameterDefaults parameterDefaults)
        {
            var subquery = new SubquerySource(selectBuilder.GenerateSelectWithoutDefaultOrderBy(), tableAliasGenerator.GenerateTableAlias());

            return(new JoinSourceQueryBuilder <TRecord>(subquery,
                                                        joinType,
                                                        source,
                                                        transaction,
                                                        tableAliasGenerator,
                                                        uniqueParameterNameGenerator,
                                                        new CommandParameterValues(ParameterValues, parameterValues),
                                                        new Parameters(Parameters, parameters),
                                                        new ParameterDefaults(ParameterDefaults, parameterDefaults)));
        }
Exemplo n.º 9
0
 public override IJoinSourceQueryBuilder <TRecord> Join(IAliasedSelectSource source, JoinType joinType, CommandParameterValues parameterValues, Parameters parameters, ParameterDefaults parameterDefaults)
 {
     return(new JoinSourceQueryBuilder <TRecord>(AsSource(),
                                                 joinType,
                                                 source,
                                                 RelationalTransaction,
                                                 TableAliasGenerator,
                                                 UniqueParameterNameGenerator,
                                                 new CommandParameterValues(ParamValues, parameterValues),
                                                 new Parameters(Params, parameters),
                                                 new ParameterDefaults(ParamDefaults, parameterDefaults)));
 }
Exemplo n.º 10
0
 public abstract IJoinSourceQueryBuilder <TRecord> Join(IAliasedSelectSource source, JoinType joinType, CommandParameterValues parameterValues, Parameters parameters, ParameterDefaults parameterDefaults);
Exemplo n.º 11
0
 public ParameterDefaults(ParameterDefaults parameterDefaults)
 {
     AddRange(parameterDefaults);
 }