コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: ColumnMap.cs プロジェクト: rogeralsing/Puzzle.NET
        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);
        }