Esempio n. 1
0
        public virtual object Clone()
        {
            List <object> tlist = null;

            if (_tables != null)
            {
                tlist = new List <object>();
                foreach (object obj in _tables)
                {
                    if (obj is SQLiteFromTable)
                    {
                        SQLiteFromTable ft = (SQLiteFromTable)obj;
                        tlist.Add(ft.Clone());
                    }
                    else if (obj is SQLiteJoinOperator)
                    {
                        tlist.Add(obj);
                    }
                } // foreach
            }

            SQLiteFromClause res = new SQLiteFromClause();

            res._tables = tlist;
            return(res);
        }
 public SQLiteSingleSelectStatement(SQLiteDistinct distinct, List <SQLiteSelectColumn> columns,
                                    SQLiteFromClause from, SQLiteExpression whereExpr, List <SQLiteExpression> groupBy,
                                    SQLiteExpression having, List <SQLiteSortItem> orderBy, SQLiteLimitClause limit)
 {
     _distinct  = distinct;
     _columns   = columns;
     _from      = from;
     _whereExpr = whereExpr;
     _groupBy   = groupBy;
     _having    = having;
     _orderBy   = orderBy;
     _limit     = limit;
 }
        public virtual object Clone()
        {
            SQLiteSelectStatement stmt = null;

            if (_select != null)
            {
                stmt = (SQLiteSelectStatement)_select.Clone();
            }
            SQLiteFromClause f = null;

            if (_from != null)
            {
                f = (SQLiteFromClause)_from.Clone();
            }
            SQLiteFromInternalTable res = new SQLiteFromInternalTable();

            res._from   = f;
            res._select = stmt;
            return(res);
        }
Esempio n. 4
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            SQLiteFromClause dst = obj as SQLiteFromClause;

            if (dst == null)
            {
                return(false);
            }

            if (!RefCompare.CompareList <object>(_tables, dst._tables))
            {
                return(false);
            }

            return(true);
        }
 public SQLiteFromInternalTable(SQLiteFromClause from)
 {
     _from = from;
 }
        public override object Clone()
        {
            SQLiteFromClause from = null;

            if (_from != null)
            {
                from = (SQLiteFromClause)_from.Clone();
            }
            SQLiteExpression whereExpr = null;

            if (_whereExpr != null)
            {
                whereExpr = (SQLiteExpression)_whereExpr.Clone();
            }
            SQLiteExpression having = null;

            if (_having != null)
            {
                having = (SQLiteExpression)_having.Clone();
            }
            SQLiteLimitClause limit = null;

            if (_limit != null)
            {
                limit = (SQLiteLimitClause)_limit.Clone();
            }
            List <SQLiteSelectColumn> columns = null;

            if (_columns != null)
            {
                columns = new List <SQLiteSelectColumn>();
                foreach (SQLiteSelectColumn c in _columns)
                {
                    columns.Add((SQLiteSelectColumn)c.Clone());
                }
            }
            List <SQLiteExpression> groupBy = null;

            if (_groupBy != null)
            {
                groupBy = new List <SQLiteExpression>();
                foreach (SQLiteExpression e in _groupBy)
                {
                    groupBy.Add((SQLiteExpression)e.Clone());
                }
            }
            List <SQLiteSortItem> orderBy = null;

            if (_orderBy != null)
            {
                orderBy = new List <SQLiteSortItem>();
                foreach (SQLiteSortItem i in _orderBy)
                {
                    orderBy.Add((SQLiteSortItem)i.Clone());
                }
            }

            SQLiteSingleSelectStatement res = new SQLiteSingleSelectStatement();

            res._distinct  = _distinct;
            res._from      = from;
            res._whereExpr = whereExpr;
            res._having    = having;
            res._limit     = limit;
            res._columns   = columns;
            res._groupBy   = groupBy;
            res._orderBy   = orderBy;
            return(res);
        }