关系数据库元数据处理类(二) 定义查询元数据接口
1 /// <summary> 2 /// 数据库元数据处理 3 /// </summary> 4 public interface IMetadata 5 { 6 #region DataBase 7 /// <summary> 8 /// 获取单个数据库对象 9 /// </summary> 10 /// <param name="specification"></param> 11 /// <returns></returns> 12 Database GetDatabase(ISpecification<Database> specification); 13 14 /// <summary> 15 /// 获取所有数据库对象 16 /// </summary> 17 /// <returns></returns> 18 List<Database> GetAllDatabase(); 19 20 /// <summary> 21 /// 根据规则查询数据库对象 22 /// </summary> 23 /// <returns></returns> 24 List<Database> FinDatabases(ISpecification<Database> specification); 25 26 #endregion 27 28 #region Table 29 30 /// <summary> 31 /// 根据规则查询表对象 32 /// </summary> 33 /// <param name="specification"></param> 34 /// <returns></returns> 35 Table GeTable(ISpecification<Table> specification); 36 37 /// <summary> 38 /// 获取所有数据库 39 /// </summary> 40 /// <returns></returns> 41 List<Table> GetAllTable(); 42 43 /// <summary> 44 /// 根据规则查询表对象 45 /// </summary> 46 /// <param name="specification"></param> 47 /// <returns></returns> 48 List<Table> FindTables(ISpecification<Table> specification); 49 50 #endregion 51 52 #region Column 53 54 /// <summary> 55 /// 根据规则,获取字段对象 56 /// </summary> 57 /// <param name="specification"></param> 58 /// <returns></returns> 59 Column GetColumn(ISpecification<Column> specification); 60 61 /// <summary> 62 /// 获取字段对象 63 /// </summary> 64 /// <returns></returns> 65 List<Column> GetAllColumns(); 66 67 /// <summary> 68 /// 根据规则,查询所有字段对象 69 /// </summary> 70 /// <param name="specification"></param> 71 /// <returns></returns> 72 List<Column> FindColumns(ISpecification<Column> specification); 73 74 #endregion 75 76 #region Relation 77 78 /// <summary> 79 /// 获取外键关系 80 /// </summary> 81 /// <returns></returns> 82 List<Relation> GetAllRelation(); 83 84 /// <summary> 85 /// 根据规则,获取外键关系 86 /// </summary> 87 /// <param name="specification"></param> 88 /// <returns></returns> 89 Relation GeRelation(ISpecification<Relation> specification); 90 91 /// <summary> 92 /// 获取表的所有主外键关系 93 /// </summary> 94 /// <param name="specification"></param> 95 /// <returns></returns> 96 List<Relation> FindRelations(ISpecification<Relation> specification); 97 98 #endregion 99 }