Пример #1
0
        public DbColumn(MetaContext context, DbTableName table, DataRow row)
            : base(context)
        {
            BaseColumnRef = new DbColumnName(context)
            {
                Name = row.GetValue<string>("BaseColumnName"),
                TableRef = new DbTableName(context)
                {
                    Catalog = row.GetValue<string>("BaseCatalogName"),
                    Name = row.GetValue<string>("BaseTableName"),
                    Schema = row.GetValue<string>("BaseSchemaName")
                }
            };

            Name = row.GetValue<string>("ColumnName");
            TableRef = table;

            AllowDBNull = row.GetValue<bool>("AllowDBNull");
            ColumnOrdinal = row.GetValue<int>("ColumnOrdinal");
            ColumnSize = row.GetValue<int>("ColumnSize");
            DataType = row.GetValue<Type>("DataType");
            IsAutoIncrement = row.GetValue<bool>("IsAutoIncrement");
            IsKey = row.GetValue<bool>("IsKey");
            IsLong = row.GetValue<bool>("IsLong");
            IsHidden = row.GetValue<bool>("IsHidden");
            IsReadOnly = row.GetValue<bool>("IsReadOnly");
            IsRowVersion = row.GetValue<bool>("IsRowVersion");
            IsUnique = row.GetValue<bool>("IsUnique");
            NumericPrecision = row.GetValue<int>("NumericPrecision");
            NumericScale = row.GetValue<int>("NumericScale");
            ProviderType = row.GetValue<string>("ProviderType");
            DataTypeName = row.GetValue<string>("DataTypeName");
        }
Пример #2
0
 public DbTable(MetaContext context, DataRow row)
     : base(context)
 {
     this.Catalog = row.GetValue<string>("TABLE_CATALOG");
     this.Schema = row.GetValue<string>("TABLE_SCHEMA");
     this.Name = row.GetValue<string>("TABLE_NAME");
     this.TableType = row.GetValue<string>("TABLE_TYPE");
 }
Пример #3
0
        public DbRelation(MetaContext context, DataRow row)
            : base(context)
        {
            PkColumnRef = GetColumnInfo(context, row, "PK");
            PkOrdinalPosition = row.GetValue<int>("PK_ORDINAL_POSITION");

            FkColumnRef = GetColumnInfo(context, row, "FK");
            FkOrdinalPosition = row.GetValue<int>("FK_ORDINAL_POSITION");

            Name = row.GetValue<string>("FK_NAME");
        }
Пример #4
0
        public DbForeignKey(MetaContext context, IList<DbRelation> columns)
            : base(context)
        {
            this.Columns = columns;

            var first = columns.First();
            this.Name = first.Name;
            this.PkTableRef = first.PkColumnRef.TableRef;
            this.FkTableRef = first.FkColumnRef.TableRef;
            this.SafeNaming = true;
        }
Пример #5
0
 private DbColumnName GetColumnInfo(MetaContext context, DataRow row, string type)
 {
     return new DbColumnName(context)
     {
         Name = row.GetValue<string>(type + "_COLUMN_NAME"),
         TableRef = new DbTableName(context)
         {
             Name = row.GetValue<string>(type + "_TABLE_NAME"),
             Schema = row.GetValue<string>(type + "_TABLE_SCHEMA"),
             Catalog = row.GetValue<string>(type + "_TABLE_CATALOG")
         }
     };
 }
Пример #6
0
 public DbOneToMany(MetaContext context, IList<DbRelation> columns)
     : base(context, columns)
 {
 }
Пример #7
0
 public DbManyToOne(MetaContext context, IList<DbRelation> columns)
     : base(context, columns)
 {
 }
Пример #8
0
 public PostgreSqlSchemaProvider(MetaContext context)
     : base(context)
 {
 }
Пример #9
0
 public OracleSchemaProvider(MetaContext context)
     : base(context)
 {
 }
Пример #10
0
 public DbColumnName(MetaContext context)
     : base(context)
 {
 }
Пример #11
0
 public DbTableName(MetaContext context, string name)
     : base(context)
 {
     var parts = name.Split('.').Reverse().ToList();
     if (parts.Count > 0) Name = parts[0];
     if (parts.Count > 1) Schema = parts[1];
     if (parts.Count > 2) Catalog = parts[2];
 }
Пример #12
0
 public DbTableName(MetaContext context)
     : base(context)
 {
 }
Пример #13
0
 public SqlServerSchemaProvider(MetaContext context)
     : base(context)
 {
 }
Пример #14
0
 public DbRelationName(MetaContext context)
     : base(context)
 {
 }
Пример #15
0
 public SQLiteSchemaProvider(MetaContext context)
     : base(context)
 {
 }
Пример #16
0
 public DbForeignKeyName(MetaContext context)
     : base(context)
 {
 }
Пример #17
0
 public ContextualizedObject(MetaContext context)
 {
     this.Context = context;
 }