예제 #1
0
        public SelectStatement(ITagMapping tag): base(tag)
		{
            SelectList = new ExpressionCollection();
            _IsDistinct = false;
            _SelectedAllColumns = false;
            _Limit = 0;
            _Offset = 0;

            _FromClause = new FromClause();
            _WhereClause = new WhereClause(BinaryLogicOperator.And);
            _OrderByClause = new OrderByClause(this);
        }
예제 #2
0
파일: OracleDialect.cs 프로젝트: npenin/uss
 public override void Visit(FromClause from_clause)
 {
     if (from_clause.Count > 0)
         base.Visit(from_clause);
     else
         _Query.Append(FROM).Append(DUAL);     // DUAL is a dummy table ever existing
 }
예제 #3
0
 private string GetParentTableName(FromClause from)
 {
     string parentTableName = string.Empty;
     Table t = from[from.Count - 1];
     if (t.GetType() == typeof(TableSource))
         parentTableName = t.TableAlias;
     else
     {
         if (t.GetType() == typeof(JoinedTable))
         {
             while (t.GetType() == typeof(JoinedTable))
             {
                 t = ((JoinedTable)t).RigthTable;
                 if (t.GetType() == typeof(TableSource))
                     break;
             }
             parentTableName = t.TableAlias;
         }
     }
     return parentTableName;
 }
예제 #4
0
파일: DBDialect.cs 프로젝트: npenin/uss
		public virtual void Visit(FromClause from_clause)
		{
            if(from_clause.Count > 0)
			    _Query.Append(FROM);

			foreach(Table table in from_clause)
			{
				if (IsSelectStatement(table))
					_Query.Append(OPENBRACE);

				table.Accept(this);

				if (IsSelectStatement(table))
				{
					_Query.Append(CLOSEBRACE).Append(FormatTableAlias(table.TableAlias)).Append(SPACE);
				}

				if ( from_clause.IndexOf(table) != from_clause.Count - 1 )
					_Query.Append(COMMA);
			}
		}