Beispiel #1
0
        public void Dispose()
        {
            whereCondition = null;
            _joinOnText    = null;
            _orderBys.Clear();
            _groupBy.Clear();
            _groupBy = null;
            _having.Clear();


            foreach (var table in _tables)
            {
                foreach (var col in table._columns)
                {
                    col.Value._asName = null;
                    col.Value.ClearValue();
                }
                table._asName        = "t1";
                table._joinCondition = null;
                table._joinType      = JoinType.Inner;
                table._sqlBuilder    = null;
            }
            _tables.Clear();
            _tables = null;
        }
Beispiel #2
0
 private QWhereCondition AddCondition(QCondition condition, WhereType type)
 {
     if (whereType == WhereType.None)
     {
         if (condition is QWhereCondition)
         {
             return((QWhereCondition)condition);
         }
         whereType     = WhereType.Single;
         leftCondition = condition;
         return(this);
     }
     if (whereType == WhereType.Single)
     {
         whereType      = type;
         rightCondition = condition;
         if (rightCondition is QWhereCondition)
         {
             rightHasOr = ((QWhereCondition)rightCondition).whereType == WhereType.Or;
         }
         return(this);
     }
     var where            = new QWhereCondition();
     where.whereType      = type;
     where.leftCondition  = this;
     where.rightCondition = condition;
     where.leftHasOr      = this.whereType == WhereType.Or;
     if (rightCondition is QWhereCondition)
     {
         where.rightHasOr = ((QWhereCondition)rightCondition).whereType == WhereType.Or;
     }
     return(where);
 }