Commit 62cdfd59 authored by 李德才's avatar 李德才

修改升级数据库执行时机

parent 393609f5
...@@ -50,16 +50,6 @@ public class MainConfig extends JFinalConfig { ...@@ -50,16 +50,6 @@ public class MainConfig extends JFinalConfig {
*/ */
private static void beforeStart() { private static void beforeStart() {
loadConfig(); loadConfig();
String dbType = p.get("dbType");
if (dbType == null || "".equals(dbType.trim())) {
System.out.println("数据库配置文件中dbType不能为空值");
return;
}
dbType = dbType.trim();
dbType = dbType.toUpperCase();
String configPath = PathKit.getRootClassPath() + "/DBUpdate/";
DBService dbService = new DBService();
dbService.upgrade(configPath, dbType);
} }
...@@ -178,6 +168,19 @@ public class MainConfig extends JFinalConfig { ...@@ -178,6 +168,19 @@ public class MainConfig extends JFinalConfig {
arp.setDialect(DialectFactory.getDialect()); arp.setDialect(DialectFactory.getDialect());
arp.addSqlTemplate("oracle.sql"); arp.addSqlTemplate("oracle.sql");
/******** 在此添加数据库 表-Model 映射 *********/ /******** 在此添加数据库 表-Model 映射 *********/
String dbType = p.get("dbType");
if (dbType == null || "".equals(dbType.trim())) {
System.out.println("数据库配置文件中dbType不能为空值");
return;
}
dbType = dbType.trim();
dbType = dbType.toUpperCase();
String configPath = PathKit.getRootClassPath() + "/DBUpdate/";
DBService dbService = new DBService();
dbService.upgrade(configPath, dbType);
// 如果使用了JFinal Model 生成器 生成了BaseModel 把下面注释解开即可 // 如果使用了JFinal Model 生成器 生成了BaseModel 把下面注释解开即可
_MappingKit.mapping(arp); _MappingKit.mapping(arp);
// 添加到插件列表中 // 添加到插件列表中
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment