Exemple #1
0
        public IQueryJoin RightJoin(QueryDef query, string alias)
        {
            var helper = new QueryDefHelper(Def);
            var source = new QuerySourceDef {
                Alias = alias, SubQuery = query
            };
            var join = helper.AddJoin(source, SqlSourceJoinType.RightOuter);

            return(new QueryJoinBuilder(this, join));
        }
Exemple #2
0
        public IQueryExpression NotIn(QueryDef subQuery, string attribute)
        {
            var helper  = new QueryDefHelper(subQuery);
            var subAttr = helper.AddAttribute(attribute);

            Condition.Right = new QueryConditionPartDef {
                SubQuery = new SubQueryDef {
                    QueryDef = subQuery, Attribute = subAttr
                }
            };
            //Condition.SubQueryDef = subQuery;
            //Condition.SubQueryAttribute = attribute;
            Condition.Condition = ConditionOperation.NotIn;
            return(GetParentExpression());
        }
Exemple #3
0
        public string SetAlias(string alias)
        {
            var helper = new QueryDefHelper(Def);
            var a      = QueryDefHelper.PrepareAlias(alias);

            if (helper.UniqueSourceAlias(a))
            {
                Def.Source.Alias = a;
            }
            else
            {
                a = helper.GetUniqueSourceAlias(a);
            }
            return(a);
        }
Exemple #4
0
        internal override QueryConditionDef CreateConditionDef(Guid attrId, ExpressionOperation operation, string source)
        {
            var def = GetDef();

            if (def != null)
            {
                var helper = new QueryDefHelper(def);

                var sourceDef = String.IsNullOrEmpty(source) ? null /*def.Source*/ : helper.FindSource(source);

                return(new QueryConditionDef
                {
                    Operation = operation,
                    Left = new QueryConditionPartDef {
                        Attribute = helper.AddAttribute(attrId, sourceDef)
                    }
                });
            }
            return(base.CreateConditionDef(attrId, operation, source));
        }
Exemple #5
0
        internal override QuerySourceDef FindSource(string alias)
        {
            var helper = new QueryDefHelper(Def);

            return(helper.FindSource(alias));
        }