Browse Source

数据库

master
郑根木 2 years ago
parent
commit
2864dded5d
1 changed files with 11 additions and 8 deletions
  1. +11
    -8
      smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/db/impl/DefaultDatabaseInfoImpl.java

+ 11
- 8
smtweb-framework/sw-framework-core/src/main/java/cc/smtweb/framework/core/db/impl/DefaultDatabaseInfoImpl.java View File

@@ -1,7 +1,10 @@
package cc.smtweb.framework.core.db.impl; package cc.smtweb.framework.core.db.impl;


import cc.smtweb.framework.core.db.DbEngine; import cc.smtweb.framework.core.db.DbEngine;
import cc.smtweb.framework.core.db.cache.ModelDatabaseCache;
import cc.smtweb.framework.core.db.vo.ModelDatabase;
import cc.smtweb.framework.core.util.SpringUtil; import cc.smtweb.framework.core.util.SpringUtil;
import com.sun.org.apache.xpath.internal.operations.Mod;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.jdbc.support.JdbcUtils; import org.springframework.jdbc.support.JdbcUtils;
@@ -113,12 +116,12 @@ public class DefaultDatabaseInfoImpl implements IDatabaseInfo {
} }
if (dbEngine.isMysql()) {//非oracle才需要 if (dbEngine.isMysql()) {//非oracle才需要
String dbName = dbEngine.getDbSchema(); String dbName = dbEngine.getDbSchema();
/*Set<String> list = .getInstance().getModelReader().getListSchema();
Collection<ModelDatabase> list = ModelDatabaseCache.getInstance().getAll();
if (list != null && !list.isEmpty()) { if (list != null && !list.isEmpty()) {
for (String catalog : list) {
getTableSet(dbData, dbName + "_" + catalog, needsUpperCase, lookupSchemaName);
for (ModelDatabase db : list) {
getTableSet(dbData, dbName + "_" + db.getName(), needsUpperCase, lookupSchemaName);
} }
}*/
}
//当前库都要去读 //当前库都要去读
getTableSet(dbData, dbName, needsUpperCase, lookupSchemaName); getTableSet(dbData, dbName, needsUpperCase, lookupSchemaName);
} else { } else {
@@ -209,12 +212,12 @@ public class DefaultDatabaseInfoImpl implements IDatabaseInfo {


if (dbEngine.isMysql()) {//非oracle才需要 if (dbEngine.isMysql()) {//非oracle才需要
String dbName = dbEngine.getDbSchema(); String dbName = dbEngine.getDbSchema();
/*Set<String> list = ModelConfigUtil.getInstance().getModelReader().getListSchema();
Collection<ModelDatabase> list = ModelDatabaseCache.getInstance().getAll();
if (list != null && !list.isEmpty()) { if (list != null && !list.isEmpty()) {
for (String catalog : list) {
getColumnInfo(dbData, dbName + "_" + catalog, needsUpperCase, lookupSchemaName);
for (ModelDatabase db : list) {
getColumnInfo(dbData, dbName + "_" + db.getName(), needsUpperCase, lookupSchemaName);
} }
}*/
}
} }


getColumnInfo(dbData, null, needsUpperCase, lookupSchemaName); getColumnInfo(dbData, null, needsUpperCase, lookupSchemaName);


Loading…
Cancel
Save