public override bool Equals(object obj) { DbObject other = obj as DbObject; if (other == null) { return(false); } string left = Identifier.Canonicalize(Identifier.ID); string right = Identifier.Canonicalize(other.Identifier.ID); if (!left.Equals(right)) { return(false); } if (m_next != null) { DbObject tail = other.Next; if (tail == null) { return(false); } else { return(m_next.Equals(tail)); } } else { return(!other.HasNext); } }
public override void PerformBefore(DbObject node) { if (node == null) { throw new ArgumentNullException("node"); } if (!node.HasNext) { if (TailorUtil.IsSysdate(node.Identifier)) { ReplaceTerm(node, new FunctionCall( TailorUtil.GetCapitalized(TailorUtil.NOW))); } if (!m_inSelectItems && (m_selectItemAliases != null)) { string key = Identifier.Canonicalize(node.Identifier.ID); if (m_selectItemAliases.ContainsKey(key)) { AliasedItem orig = m_selectItemAliases[key]; ReplaceTerm(node, orig.Item.Clone()); } } } base.PerformBefore(node); }
public TableWildcard(DbObject dbObject) { if (dbObject == null) { throw new ArgumentNullException("dbObject"); } m_dbObject = dbObject; }
public INode Clone() { DbObject dbObject = new DbObject((Identifier)(m_identifier.Clone())); if (m_next != null) { dbObject.Add((DbObject)(m_next.Clone())); } return(dbObject); }
public override void PerformAfter(DbObject node) { if (node == null) { throw new ArgumentNullException("node"); } if (node.HasNext) { m_sql.Append('.'); } }
static bool IsRownumTerm(INode arg) { arg = GetComparedTerm(arg); DbObject dbObject = arg as DbObject; if ((dbObject == null) || dbObject.HasNext) { return(false); } return(IsRownum(dbObject.Identifier)); }
public override void PerformBefore(DbObject node) { if (node == null) { throw new ArgumentNullException("node"); } if (!node.HasNext && TailorUtil.IsSysdate(node.Identifier)) { ReplaceTerm(node, new FunctionCall(TailorUtil.GETDATE.ToUpperInvariant())); } base.PerformBefore(node); }
public Assignment(DbObject name, INode val) { if (name == null) { throw new ArgumentNullException("name"); } if (val == null) { throw new ArgumentNullException("val"); } m_name = name; m_value = val; }
public override void PerformBefore(DbObject node) { if (node == null) { throw new ArgumentNullException("node"); } if (!node.HasNext && TailorUtil.IsSysdate(node.Identifier)) { ReplaceTerm(node, new DbObject(new Identifier( TailorUtil.CURRENT_TIMESTAMP.ToUpperInvariant()))); } base.PerformBefore(node); }
public void Add(DbObject tail) { if (tail == null) { throw new ArgumentNullException("tail"); } if (m_next == null) { m_next = tail; } else { m_next.Add(tail); } }
public override void PerformBefore(QueryExpression node) { if (node == null) { throw new ArgumentNullException("node"); } base.PerformBefore(node); if (node.Where == null) { AliasedItem from = node.From; if ((from != null) && (from.Alias == null) && !from.HasNext) { Table singleTable = from.Item as Table; if ((singleTable != null) && (singleTable.Alias == null) && (singleTable.JoinCondition == null) && (singleTable.JoinType == null) && !singleTable.HasNext) { DbObject singleName = TailorUtil.GetTerm( singleTable.Source) as DbObject; if ((singleName != null) && !singleName.HasNext) { Identifier identifier = singleName.Identifier; // Not canonicalizing - we're accepting quoted "dual" // as a regular identifier. if (TailorUtil.DUAL.Equals( identifier.ID.ToLowerInvariant())) { node.From = null; } } } } } if (node.LimitFormat != ' ') { node.LimitFormat = 'L'; } }
public int CompareTo(object obj) { DbObject other = obj as DbObject; if (other == null) { throw new ArgumentException("Object is not a DbObject.", "obj"); } string left = Identifier.Canonicalize(Identifier.ID); string right = Identifier.Canonicalize(other.Identifier.ID); int cmp = left.CompareTo(right); if (cmp != 0) { return(cmp); } if (m_next != null) { DbObject tail = other.Next; if (tail == null) { return(1); } else { return(m_next.CompareTo(tail)); } } else { return(other.HasNext ? -1 : 0); } }
public virtual void PerformAfter(DbObject node) { }
public virtual void PerformBefore(DbObject node) { }
public override void PerformAfter(DbObject node) { PopKnownParent(node); }
public override void PerformBefore(DbObject node) { PushParent(node); }