public override void DeepMerge(IMap mapObject) { Copy(mapObject); ITableMap tableMap = (ITableMap)mapObject; IColumnMap columnMap; IColumnMap checkColumnMap; ArrayList remove = new ArrayList(); foreach (IColumnMap iColumnMap in this.ColumnMaps) { checkColumnMap = tableMap.GetColumnMap(iColumnMap.Name); if (checkColumnMap == null) { checkColumnMap = (IColumnMap)iColumnMap.DeepClone(); checkColumnMap.TableMap = tableMap; } else { iColumnMap.DeepMerge(checkColumnMap); } } foreach (IColumnMap iColumnMap in tableMap.ColumnMaps) { columnMap = this.GetColumnMap(iColumnMap.Name); if (columnMap == null) { remove.Add(iColumnMap); } } foreach (IColumnMap iColumnMap in remove) { tableMap.ColumnMaps.Remove(iColumnMap); } }
public override bool DeepCompare(IMap compareTo) { if (!(Compare(compareTo))) { return(false); } ITableMap tableMap = (ITableMap)compareTo; IColumnMap checkColumnMap; if (!(this.ColumnMaps.Count == tableMap.ColumnMaps.Count)) { return(false); } foreach (IColumnMap columnMap in this.ColumnMaps) { checkColumnMap = tableMap.GetColumnMap(columnMap.Name); if (checkColumnMap == null) { return(false); } else { if (!(columnMap.DeepCompare(checkColumnMap))) { return(false); } } } return(true); }
public virtual IColumnMap GetPrimaryKeyColumnMap() { if (m_PrimaryKeyTable.Length < 1) { return(null); } if (m_PrimaryKeyColumn.Length < 1) { return(null); } ITableMap tableMap = GetPrimaryKeyTableMap(); if (tableMap != null) { return(tableMap.GetColumnMap(m_PrimaryKeyColumn)); } return(null); }