public override bool Equals(object obj) { if (obj == null) { return(false); } SQLiteSingleSelectStatement dst = obj as SQLiteSingleSelectStatement; if (dst == null) { return(false); } if (_distinct != dst._distinct) { return(false); } if (!RefCompare.CompareMany(_from, dst._from, _whereExpr, dst._whereExpr, _having, dst._having, _limit, dst._limit)) { return(false); } if (!RefCompare.CompareList <SQLiteSelectColumn>(_columns, dst._columns)) { return(false); } if (!RefCompare.CompareList <SQLiteExpression>(_groupBy, dst._groupBy)) { return(false); } if (!RefCompare.CompareList <SQLiteSortItem>(_orderBy, dst._orderBy)) { return(false); } return(base.Equals(obj)); }
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); }