mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-04 12:17:41 +08:00
PL-10070 Speed up getting information about tables on Oracle
This commit is contained in:
parent
e9c258de8d
commit
533cc126e8
@ -159,8 +159,8 @@ public class DbUpdaterEngine implements DbUpdater {
|
||||
connection = getDataSource().getConnection();
|
||||
DatabaseMetaData dbMetaData = connection.getMetaData();
|
||||
DbProperties dbProperties = new DbProperties(getConnectionUrl(connection));
|
||||
boolean useUserForSchemaName = DbmsSpecificFactory.getDbmsFeatures().useUserForSchemaName();
|
||||
String schemaName = useUserForSchemaName ?
|
||||
boolean isSchemaByUser = DbmsSpecificFactory.getDbmsFeatures().isSchemaByUser();
|
||||
String schemaName = isSchemaByUser ?
|
||||
dbMetaData.getUserName() : dbProperties.getCurrentSchemaProperty();
|
||||
ResultSet tables = dbMetaData.getTables(null, schemaName, null, null);
|
||||
boolean found = false;
|
||||
|
@ -73,9 +73,7 @@ public interface DbmsFeatures {
|
||||
boolean isNullsLastSorting();
|
||||
|
||||
/**
|
||||
* Uses user name as schema name for Oracle database
|
||||
* for correct table lookup {@link java.sql.DatabaseMetaData#getTables}.
|
||||
* By default it returns all tables for all users in the Oracle database
|
||||
* @return true if user name must be used when providing schema name for obtaining database metadata
|
||||
*/
|
||||
boolean useUserForSchemaName();
|
||||
boolean isSchemaByUser();
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ public class HsqlDbmsFeatures implements DbmsFeatures {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useUserForSchemaName() {
|
||||
public boolean isSchemaByUser() {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -69,7 +69,7 @@ public class MssqlDbmsFeatures implements DbmsFeatures {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useUserForSchemaName() {
|
||||
public boolean isSchemaByUser() {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -68,7 +68,7 @@ public class MysqlDbmsFeatures implements DbmsFeatures {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useUserForSchemaName() {
|
||||
public boolean isSchemaByUser() {
|
||||
return false;
|
||||
}
|
||||
}
|
@ -74,7 +74,7 @@ public class OracleDbmsFeatures implements DbmsFeatures {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useUserForSchemaName() {
|
||||
public boolean isSchemaByUser() {
|
||||
return true;
|
||||
}
|
||||
}
|
@ -69,7 +69,7 @@ public class PostgresDbmsFeatures implements DbmsFeatures {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useUserForSchemaName() {
|
||||
public boolean isSchemaByUser() {
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user