public TableField(Table table, string name, string description) : base(name, description) { if (null == table) throw new ArgumentNullException("table"); this.Table = table; }
public void ToSql(StringBuilder builder, Table primaryTable, List<Table> skip) { if (null == builder) throw new ArgumentNullException("builder"); if (null != this.MasterTable && !String.IsNullOrEmpty(this.MasterTable.Name) && null != this.MasterField && !String.IsNullOrEmpty(this.MasterField.Name) && null != this.DetailsTable && !String.IsNullOrEmpty(this.DetailsTable.Name) && null != this.DetailsField && !String.IsNullOrEmpty(this.DetailsField.Name)) { Table table = null; if (!skip.Contains(this.MasterTable) && primaryTable != this.MasterTable) table = this.MasterTable; if (null == table && !skip.Contains(this.DetailsTable) && primaryTable != this.DetailsTable) table = this.DetailsTable; if (null != table) { builder.Append(" "); builder.AppendFormat("left join [{0}] on ", table.Name); this.MasterField.ToSql(builder, this.MasterField.Alias); builder.Append(" = "); this.DetailsField.ToSql(builder, this.DetailsField.Alias); } } }
public TableField(Table table, string name, string description, string dbtype, bool isPrimaryKey) : this(table, name, description, dbtype) { this.IsPrimaryKey = isPrimaryKey; }
public TableField(Table table, string name, string description, string dbtype) : this(table, name, description) { this.DBType = dbtype; }