示例#1
0
        public LeftOuterJoinIterator(Iterator iterator, LeftOuterJoin leftOuterJoin)
        {
            this._iterator      = iterator;
            this._leftOuterJoin = leftOuterJoin;

            //TODO get RowCount from database.
        }
示例#2
0
        public Join <TDto> LeftOuterJoin(string tableName, string tableAlias = null, string dbSchema = "dbo")
        {
            var leftOuterJoin = new LeftOuterJoin <TDto>(_spry, this, new SprySelectTable <TDto>(_spry, tableName, tableAlias, dbSchema));

            _joins.Add(leftOuterJoin);
            return(leftOuterJoin);
        }
 protected override void VisitLeftOuterJoin(LeftOuterJoin item)
 {
     if (_DetectingMetadataQuery)
     {
         item.RightHand.Source.Accept(this);
     }
 }
示例#4
0
        /// <summary>
        /// Generates the text for a LeftOuterJoin builder.
        /// </summary>
        /// <param name="item">The LeftOuterJoin builder to generate the text for.</param>
        protected internal override void VisitLeftOuterJoin(LeftOuterJoin item)
        {
            StringBuilder joinBuilder = new StringBuilder("LEFT ");

            if (options.VerboseOuterJoin)
            {
                joinBuilder.Append("OUTER ");
            }
            joinBuilder.Append("JOIN");
            visitFilteredJoin(item, joinBuilder.ToString());
        }
示例#5
0
    public void LeftOuterJoin1Test()
    {
        var sw = InitTest();

        LeftOuterJoin.LeftOuterJoin1();
        Assert.Equal(
            @"Magnus:        Daisy
Terry:         Barley
Terry:         Boots
Terry:         Blue Moon
Charlotte:     Whiskers
Arlene:        
", sw.ToString());
    }
示例#6
0
        internal static bool TryParseSources(ScriptParser Parser, out SourceDefinition Source)
        {
            if (!TryParseSource(Parser, out Source))
            {
                return(false);
            }

            while (true)
            {
                string s = Parser.PeekNextToken().ToUpper();

                switch (s)
                {
                case ",":
                    Parser.NextToken();
                    if (!TryParseSource(Parser, out SourceDefinition Source2))
                    {
                        return(false);
                    }

                    Source = new CrossJoin(Source, Source2, Source.Start, Parser.Position - Source.Start, Parser.Expression);
                    break;

                case "INNER":
                case "JOIN":
                    Parser.NextToken();

                    if (s == "INNER")
                    {
                        if (Parser.NextToken().ToUpper() != "JOIN")
                        {
                            return(false);
                        }
                    }

                    if (!TryParseSource(Parser, out Source2))
                    {
                        return(false);
                    }

                    ScriptNode Conditions = ParseJoinConditions(Parser);
                    Source = new InnerJoin(Source, Source2, Conditions, Source.Start, Parser.Position - Source.Start, Parser.Expression);
                    break;

                case "LEFT":
                    Parser.NextToken();

                    switch (Parser.NextToken().ToUpper())
                    {
                    case "JOIN":
                        break;

                    case "OUTER":
                        if (Parser.NextToken().ToUpper() != "JOIN")
                        {
                            return(false);
                        }
                        break;

                    default:
                        return(false);
                    }

                    if (!TryParseSource(Parser, out Source2))
                    {
                        return(false);
                    }

                    Conditions = ParseJoinConditions(Parser);
                    Source     = new LeftOuterJoin(Source, Source2, Conditions, Source.Start, Parser.Position - Source.Start, Parser.Expression);
                    break;

                case "RIGHT":
                    Parser.NextToken();

                    switch (Parser.NextToken().ToUpper())
                    {
                    case "JOIN":
                        break;

                    case "OUTER":
                        if (Parser.NextToken().ToUpper() != "JOIN")
                        {
                            return(false);
                        }
                        break;

                    default:
                        return(false);
                    }

                    if (!TryParseSource(Parser, out Source2))
                    {
                        return(false);
                    }

                    Conditions = ParseJoinConditions(Parser);
                    Source     = new RightOuterJoin(Source, Source2, Conditions, Source.Start, Parser.Position - Source.Start, Parser.Expression);
                    break;

                case "FULL":
                    Parser.NextToken();

                    switch (Parser.NextToken().ToUpper())
                    {
                    case "JOIN":
                        break;

                    case "OUTER":
                        if (Parser.NextToken().ToUpper() != "JOIN")
                        {
                            return(false);
                        }
                        break;

                    default:
                        return(false);
                    }

                    if (!TryParseSource(Parser, out Source2))
                    {
                        return(false);
                    }

                    Conditions = ParseJoinConditions(Parser);
                    Source     = new FullOuterJoin(Source, Source2, Conditions, Source.Start, Parser.Position - Source.Start, Parser.Expression);
                    break;

                case "OUTER":
                    Parser.NextToken();

                    if (Parser.NextToken().ToUpper() != "JOIN")
                    {
                        return(false);
                    }

                    if (!TryParseSource(Parser, out Source2))
                    {
                        return(false);
                    }

                    Conditions = ParseJoinConditions(Parser);
                    Source     = new FullOuterJoin(Source, Source2, Conditions, Source.Start, Parser.Position - Source.Start, Parser.Expression);
                    break;

                default:
                    return(true);
                }
            }
        }
 private void AddJoin(LeftOuterJoin item)
 {
     this.IsSingleSource = false;
     throw new NotSupportedException();
     //  AddJoin(item, JoinOperator.LeftOuter);
 }
 protected override void VisitLeftOuterJoin(LeftOuterJoin item)
 {
     this.AddJoin(item);
 }
 private void AddJoin(LeftOuterJoin item)
 {
     AddJoin(item, JoinOperator.LeftOuter);
 }
示例#10
0
        public void ShowExample_Click(object sender, EventArgs e)
        {
            Form form = null;

            switch (((Button)sender).Name)
            {
            // LINQ Dynamic | Restriction Operators
            case "uiROWhere":
                form = new Where();
                break;

            // LINQ Dynamic | Projection Operators
            case "uiPOSelect":
                form = new Select();
                break;

            case "uiPOSelectMany":
                form = new SelectMany();
                break;

            // LINQ Dynamic | Aggregate Operators
            case "uiAOMin":
                form = new Min();
                break;

            case "uiAOMax":
                form = new Max();
                break;

            case "uiAOSum":
                form = new Sum();
                break;

            case "uiAOCount":
                form = new Count();
                break;

            case "uiAOAverage":
                form = new Average();
                break;

            case "uiAOAggregate":
                form = new Aggregate();
                break;

            // LINQ Dynamic | Query Execution
            case "uiQEDeferredExecution":
                form = new DeferredExecution();
                break;

            case "uiQEQueryReuse":
                form = new QueryReuse();
                break;

            case "uiQEImmediateExecution":
                form = new ImmediateExecution();
                break;


            // LINQ Dynamic |  Join Operators
            case "uiJOCrossJoin":
                form = new CrossJoin();
                break;

            case "uiJOGroupJoin":
                form = new GroupJoin();
                break;

            case "uiJOCrossWithGroupJoin":
                form = new CrossJoinwithGroupJoin();
                break;

            case "uiJOLeftOuterJoin":
                form = new LeftOuterJoin();
                break;

            // LINQ Dynamic |    Set Operators
            case "uiSODistinct":
                form = new Distinct();
                break;

            case "uiSOExcept":
                form = new Except();
                break;

            case "uiSOIntersect":
                form = new Intersect();
                break;

            case "uiSOUnion":
                form = new Union();
                break;

            // LINQ Dynamic |    Element Operators
            case "uiEOElementAt":
                form = new ElementAt();
                break;

            case "uiEOFirst":
                form = new First();
                break;

            case "uiEOFirstDefault":
                form = new FirstOrDefault();
                break;

            // LINQ Dynamic |    Custom Sequence Operators
            case "uiCSOCombine":
                form = new Combine();
                break;

            // LINQ Dynamic |    Quantifiers
            case "uiQuantifiersAll":
                form = new All();
                break;

            case "uiQuantifiersAny":
                form = new Any();
                break;

            // LINQ Dynamic |    Grouping Operators
            case "uiGOGroupBy":
                form = new GroupBy();
                break;

            // LINQ Dynamic |    Miscellaneous Operators
            case "uiMOConcat":
                form = new Concat();
                break;

            case "uiMOEqualAll":
                form = new EqualAll();
                break;


            // LINQ Dynamic |    Generation Operators
            case "uiGORepeat":
                form = new Repeat();
                break;

            case "uiGORange":
                form = new Range();
                break;


            // LINQ Dynamic |    Ordering Operators
            case "uiOOOrderBy":
                form = new OrderBy();
                break;

            case "uiOOThenBy":
                form = new ThenBy();
                break;

            case "uiOOThenByDescending":
                form = new ThenByDescending();
                break;

            case "uiOOOrderByDescending":
                form = new OrderByDescending();
                break;

            case "uiOOReverse":
                form = new Reverse();
                break;

            // LINQ Dynamic |    Conversion Operators
            case "uiCOOfType":
                form = new OfType();
                break;

            case "uiCOToArray":
                form = new ToArray();
                break;

            case "uiCOToDictionary":
                form = new ToDictionary();
                break;

            case "uiCOToList":
                form = new ToList();
                break;


            // LINQ Dynamic |    Partitioning Operators
            case "uiPOTake":
                form = new Take();
                break;

            case "uiPOTakeWhile":
                form = new TakeWhile();
                break;

            case "uiPOSkip":
                form = new Skip();
                break;

            case "uiPOSkipWhile":
                form = new SkipWhile();
                break;
            }

            form.StartPosition = FormStartPosition.CenterParent;
            form.ShowDialog();
        }