From 1c3ba6eb84d87a77ab38eddc58e1751418341e94 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sat, 7 Oct 2017 11:56:01 +0800 Subject: [PATCH] - --- Src/Asp.Net/OracleTest/Demos/5_DbFirst.cs | 12 ++++---- .../DbMaintenance/OracleDbMaintenance.cs | 29 ++++++++++++++----- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/Src/Asp.Net/OracleTest/Demos/5_DbFirst.cs b/Src/Asp.Net/OracleTest/Demos/5_DbFirst.cs index 7e79a7734..8d0bb0f6e 100644 --- a/Src/Asp.Net/OracleTest/Demos/5_DbFirst.cs +++ b/Src/Asp.Net/OracleTest/Demos/5_DbFirst.cs @@ -12,28 +12,28 @@ namespace OrmTest.Demo { var db = GetInstance(); //Create all class - db.DbFirst.CreateClassFile("c:\\Demo\\1"); + db.DbFirst.CreateClassFile("c:\\DemoOracle\\1"); //Create student calsss - db.DbFirst.Where("Student").CreateClassFile("c:\\Demo\\2"); + db.DbFirst.Where("Student").CreateClassFile("c:\\DemoOracle\\2"); //Where(array) //Mapping name db.MappingTables.Add("ClassStudent", "Student"); db.MappingColumns.Add("NewId", "Id", "ClassStudent"); - db.DbFirst.Where("Student").CreateClassFile("c:\\Demo\\3"); + db.DbFirst.Where("Student").CreateClassFile("c:\\DemoOracle\\3"); //Remove mapping db.MappingTables.Clear(); //Create class with default value - db.DbFirst.IsCreateDefaultValue().CreateClassFile("c:\\Demo\\4", "Demo.Models"); + db.DbFirst.IsCreateDefaultValue().CreateClassFile("c:\\DemoOracle\\4", "DemoOracle.Models"); //Mapping and Attribute db.MappingTables.Add("ClassStudent", "Student"); db.MappingColumns.Add("NewId", "Id", "ClassStudent"); - db.DbFirst.IsCreateAttribute().Where("Student").CreateClassFile("c:\\Demo\\5"); + db.DbFirst.IsCreateAttribute().Where("Student").CreateClassFile("c:\\DemoOracle\\5"); //Remove mapping @@ -66,7 +66,7 @@ namespace OrmTest.Demo { return old; }) - .CreateClassFile("c:\\Demo\\6"); + .CreateClassFile("c:\\DemoOracle\\6"); } } } \ No newline at end of file diff --git a/Src/Asp.Net/SqlSugar/Realization/Oracle/DbMaintenance/OracleDbMaintenance.cs b/Src/Asp.Net/SqlSugar/Realization/Oracle/DbMaintenance/OracleDbMaintenance.cs index 0b45a33bd..ec631b211 100644 --- a/Src/Asp.Net/SqlSugar/Realization/Oracle/DbMaintenance/OracleDbMaintenance.cs +++ b/Src/Asp.Net/SqlSugar/Realization/Oracle/DbMaintenance/OracleDbMaintenance.cs @@ -14,25 +14,38 @@ namespace SqlSugar { get { - return null; + throw new NotSupportedException(); } } protected override string GetTableInfoListSql { get { - return @"SELECT s.Name,Convert(varchar(max),tbp.value) as Description - FROM sysobjects s - LEFT JOIN sys.extended_properties as tbp ON s.id=tbp.major_id and tbp.minor_id=0 WHERE s.xtype IN('U') AND (tbp.Name='MS_Description' OR tbp.Name is null)"; + return @"SELECT table_name name from user_tables where + table_name!='HELP' + AND table_name NOT LIKE '%$%' + AND table_name NOT LIKE 'LOGMNRC_%' + AND table_name!='LOGMNRP_CTAS_PART_MAP' + AND table_name!='LOGMNR_LOGMNR_BUILDLOG' + AND table_name!='SQLPLUS_PRODUCT_PROFILE' + UNION all + select view_name name from user_views + WHERE VIEW_name NOT LIKE '%$%' + AND VIEW_NAME !='PRODUCT_PRIVS' + AND VIEW_NAME NOT LIKE 'MVIEW_%' "; } } protected override string GetViewInfoListSql { get { - return @"SELECT s.Name,Convert(varchar(max),tbp.value) as Description - FROM sysobjects s - LEFT JOIN sys.extended_properties as tbp ON s.id=tbp.major_id and tbp.minor_id=0 WHERE s.xtype IN('V') AND (tbp.Name='MS_Description' OR tbp.Name is null)"; + return @"SELECT table_name name from user_tables where + table_name != 'HELP' + AND table_name NOT LIKE '%$%' + AND table_name NOT LIKE 'LOGMNRC_%' + AND table_name!= 'LOGMNRP_CTAS_PART_MAP' + AND table_name!= 'LOGMNR_LOGMNR_BUILDLOG' + AND table_name!= 'SQLPLUS_PRODUCT_PROFILE'"; } } #endregion @@ -129,7 +142,7 @@ namespace SqlSugar { get { - return "select top 1 id from sysobjects"; + return "select t.table_name from user_tables t where rownum=1"; } } #endregion