示例#1
0
        private void GetColumnData(TableMap map)
        {
            string    sql = String.Format(selectColumns, map.TableId);
            SqlResult sr  = broker.Execute(sql);

            for (int i = 0; i < sr.Rows.Count; i++)
            {
                string   column     = sr.GetString(i, "column_name");
                FieldMap fm         = map.GetFieldMapFromColumn(column);
                bool     isNullable = sr.GetString(i, "nulls").Equals("Y");
                if (fm != null)
                {
                    fm.ColumnId = sr.GetInt(i, "column_id");
                    fm.SetDbType(sr.GetString(i, "domain_name"), false);
                    fm.SetIsNullable(isNullable);
                    fm.SetSize(sr.GetInt(i, "width"));
                }
                else                 // raise an error if we've detected a database/type mismatch
                {
                    // TODO disabled due to code restructuring
                    // Check.Verify( isNullable, Error.NoPropertyForNotNullColumn, column, map.Type );
                }
            }
        }