Beispiel #1
0
        public List <TableJoinInfo> Parse(SelectAtomContext ctx)
        {
            var rslt = new List <TableJoinInfo>();

            if (Table_alias_list != null)
            {
                foreach (var t in Table_alias_list)
                {
                    var joinTable = new TableJoinInfo();
                    t.Parse(joinTable);
                    joinTable.JoinType = JoinType.Outer;

                    rslt.Add(joinTable);
                }
                rslt[0].JoinType = JoinType.First;
                //return rslt;
            }
            if (Select_alias != null)
            {
                var selectCtx = Select_alias.Parse(ctx);
                //selectCtx.TableJoinInfos[0].JoinType = JoinType.First;
                //rslt.Add(selectCtx.TableJoinInfos[0]);
            }
            return(rslt);
        }
Beispiel #2
0
        public void Parse(TableJoinInfo ctx)
        {
            if (Table_alias == null)
            {
                return;
            }

            //if (Table_alias != null && !string.IsNullOrWhiteSpace(Table_alias.Alias))
            if (Table_alias != null)
            {
                Table_alias.Parse(ctx);
            }

            if (!string.IsNullOrWhiteSpace(Join_type))
            {
                switch (Join_type.ToLower().Trim())
                {
                case "leftouterjoin":
                case "leftjoin":
                    ctx.JoinType = JoinType.Left;
                    break;

                case "rightouterjoin":
                case "rightjoin":
                    ctx.JoinType = JoinType.Right;
                    break;

                case "innerjoin":
                    ctx.JoinType = JoinType.Inner;
                    break;

                case "outerjoin":
                case "outer":
                    ctx.JoinType = JoinType.Outer;
                    break;

                default:
                    ctx.JoinType = JoinType.Unkown;
                    break;
                }
            }

            //rslt.ParentContext = ctx;

            if (Join_on_clause != null)
            {
                ctx.Condition = new OrConditionInfo();
                Join_on_clause.Parse(ctx.Condition);
            }

            //rslt.ParentContext = ctx;
            //return rslt;
        }
Beispiel #3
0
        public void Parse(TableJoinInfo ctx)
        {
            if (Table_alias == null)
                return ;

            //if (Table_alias != null && !string.IsNullOrWhiteSpace(Table_alias.Alias))
            if (Table_alias != null)
            {
                Table_alias.Parse(ctx);
            }

            if ( !string.IsNullOrWhiteSpace(Join_type))
            {
                switch(Join_type.ToLower().Trim())
                {
                    case "leftouterjoin":
                    case "leftjoin":
                        ctx.JoinType = JoinType.Left;
                        break;
                    case "rightouterjoin":
                    case "rightjoin":
                        ctx.JoinType = JoinType.Right;
                        break;
                    case "innerjoin":
                        ctx.JoinType = JoinType.Inner;
                        break;
                    case "outerjoin":
                    case "outer":
                        ctx.JoinType = JoinType.Outer;
                        break;
                    default:
                        ctx.JoinType = JoinType.Unkown;
                        break;
                }
            }

            //rslt.ParentContext = ctx;

            if (Join_on_clause != null)
            {
                ctx.Condition = new OrConditionInfo();
                Join_on_clause.Parse(ctx.Condition);
            }

            //rslt.ParentContext = ctx;
            //return rslt;
        }
        public List<TableJoinInfo> Parse(SelectAtomContext ctx)
        {
            if (Join_clause_list == null || Join_clause_list.Count == 0)
                return null;

            var rslt = new List<TableJoinInfo>();

            foreach (var join in this.Join_clause_list)
            {
                var temp = new TableJoinInfo();
                rslt.Add(temp);
                join.Parse(temp);

                //rslt = rslt.Join(temp);
            }

            //rslt.ParentContext = ctx;
            return rslt;
        }
Beispiel #5
0
        public List <TableJoinInfo> Parse(SelectAtomContext ctx)
        {
            if (Join_clause_list == null || Join_clause_list.Count == 0)
            {
                return(null);
            }

            var rslt = new List <TableJoinInfo>();

            foreach (var join in this.Join_clause_list)
            {
                var temp = new TableJoinInfo();
                rslt.Add(temp);
                join.Parse(temp);

                //rslt = rslt.Join(temp);
            }

            //rslt.ParentContext = ctx;
            return(rslt);
        }
Beispiel #6
0
 public void Parse(TableJoinInfo ctx)
 {
     ctx.RightTable = Table.Text;
     ctx.Alias      = Alias;
 }
Beispiel #7
0
 public void Parse(TableJoinInfo ctx)
 {
     ctx.RightTable =  Table.Text;
     ctx.Alias = Alias;
 }