예제 #1
0
        /// <summary>
        /// Adiciona um indice para a instancia.
        /// </summary>
        /// <param name="rs"></param>
        /// <param name="meta"></param>
        private void AddIndex(System.Data.DataRow rs, IDataBaseSchema meta)
        {
            string index = GetIndexName(rs);

            if (string.IsNullOrEmpty(index))
            {
                return;
            }
            IIndexMetadata info = GetIndexMetadata(index);

            if (info == null)
            {
                info = GetIndexMetadata(rs);
                _indexes[info.Name.ToLowerInvariant()] = info;
            }
            foreach (System.Data.DataRow row in meta.GetIndexColumns(_catalog, _schema, _name, index).Rows)
            {
                info.AddColumn(GetColumnMetadata(GetColumnName(row)));
            }
        }
예제 #2
0
        /// <summary>
        /// Adiciona uma chave estrangeira para a instancia.
        /// </summary>
        /// <param name="rs">Linha que contem</param>
        /// <param name="meta"></param>
        private void AddForeignKey(System.Data.DataRow rs, IDataBaseSchema meta)
        {
            string fk = GetConstraintName(rs);

            if (string.IsNullOrEmpty(fk))
            {
                return;
            }
            IForeignKeyMetadata info = GetForeignKeyMetadata(fk);

            if (info == null)
            {
                info = GetForeignKeyMetadata(rs);
                _foreignKeys[info.Name.ToLowerInvariant()] = info;
            }
            foreach (System.Data.DataRow row in meta.GetIndexColumns(_catalog, _schema, _name, fk).Rows)
            {
                info.AddColumn(GetColumnMetadata(GetColumnName(row)));
            }
        }
        private void AddIndex(DataRow rs, IDataBaseSchema meta)
        {
            string index = GetIndexName(rs);

            if (string.IsNullOrEmpty(index))
            {
                return;
            }

            IIndexMetadata info = GetIndexMetadata(index);

            if (info == null)
            {
                info = GetIndexMetadata(rs);
                indexes[info.Name] = info;
            }

            foreach (DataRow row in meta.GetIndexColumns(catalog, schema, name, index).Rows)
            {
                info.AddColumn(GetColumnMetadata(GetColumnName(row)));
            }
        }
        private void AddForeignKey(DataRow rs, IDataBaseSchema meta)
        {
            string fk = GetConstraintName(rs);

            if (string.IsNullOrEmpty(fk))
            {
                return;
            }

            IForeignKeyMetadata info = GetForeignKeyMetadata(fk);

            if (info == null)
            {
                info = GetForeignKeyMetadata(rs);
                foreignKeys[info.Name] = info;
            }

            foreach (DataRow row in meta.GetIndexColumns(catalog, schema, name, fk).Rows)
            {
                info.AddColumn(GetColumnMetadata(GetColumnName(row)));
            }
        }
		private void AddForeignKey(DataRow rs, IDataBaseSchema meta)
		{
			string fk = GetConstraintName(rs);

			if (string.IsNullOrEmpty(fk))
				return;

			IForeignKeyMetadata info = GetForeignKeyMetadata(fk);
			if (info == null)
			{
				info = GetForeignKeyMetadata(rs);
				foreignKeys[info.Name.ToLowerInvariant()] = info;
			}

			foreach (DataRow row in meta.GetIndexColumns(catalog, schema, name, fk).Rows)
			{
				info.AddColumn(GetColumnMetadata(GetColumnName(row)));
			}
		}
		private void AddIndex(DataRow rs, IDataBaseSchema meta)
		{
			string index = GetIndexName(rs);

			if (string.IsNullOrEmpty(index)) return;

			IIndexMetadata info = GetIndexMetadata(index);
			if (info == null)
			{
				info = GetIndexMetadata(rs);
				indexes[info.Name.ToLowerInvariant()] = info;
			}

			foreach (DataRow row in meta.GetIndexColumns(catalog, schema, name, index).Rows)
			{
				info.AddColumn(GetColumnMetadata(GetColumnName(row)));
			}
		}