提交 cbedb098 编写于 作者: T titou10

DB2 : Cosmetics around schema with spaces

上级 88550990
......@@ -60,6 +60,8 @@ public class DB2Routine extends DB2Object<DBSObject> implements DBSProcedure, DB
private final DB2RoutineParmsCache parmsCache = new DB2RoutineParmsCache();
private String fullyQualifiedName;
private DB2Schema db2Schema;
private DB2RoutineType type;
......@@ -139,6 +141,9 @@ public class DB2Routine extends DB2Object<DBSObject> implements DBSProcedure, DB
db2Schema = ((DB2Module) owner).getSchema();
}
// Compute this once for all
fullyQualifiedName = DBUtils.getFullQualifiedName(db2DataSource, owner, this);
}
public DB2RoutineType getType()
......@@ -176,9 +181,7 @@ public class DB2Routine extends DB2Object<DBSObject> implements DBSProcedure, DB
@Override
public String getFullQualifiedName()
{
return DBUtils.getFullQualifiedName(getDataSource(),
parent,
this);
return fullyQualifiedName;
}
@Override
......
......@@ -18,9 +18,9 @@
*/
package org.jkiss.dbeaver.ext.db2.model;
import org.jkiss.dbeaver.core.Log;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.core.Log;
import org.jkiss.dbeaver.ext.db2.DB2Constants;
import org.jkiss.dbeaver.ext.db2.model.cache.DB2AliasCache;
import org.jkiss.dbeaver.ext.db2.model.cache.DB2IndexCache;
......@@ -52,7 +52,10 @@ import org.jkiss.utils.CommonUtils;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
/**
* DB2Schema
......@@ -62,6 +65,8 @@ import java.util.*;
public class DB2Schema extends DB2GlobalObject implements DBSSchema, DBPRefreshableObject, DBPSystemObject {
private static final Log LOG = Log.getLog(DB2Schema.class);
private static final List<String> SYSTEM_SCHEMA = Arrays.asList("SYS", "DB2QP", "SQLJ", "NULLID");
private static final String C_SEQ = "SELECT * FROM SYSCAT.SEQUENCES WHERE SEQSCHEMA = ? AND SEQTYPE <> 'A' ORDER BY SEQNAME WITH UR";
private static final String C_PKG = "SELECT * FROM SYSCAT.PACKAGES WHERE PKGSCHEMA = ? ORDER BY PKGNAME WITH UR";
private static final String C_XSR = "SELECT * FROM SYSCAT.XSROBJECTS WHERE OBJECTSCHEMA = ? ORDER BY OBJECTNAME WITH UR";
......@@ -154,19 +159,7 @@ public class DB2Schema extends DB2GlobalObject implements DBSSchema, DBPRefresha
@Override
public boolean isSystem()
{
if (getName().startsWith("SYS")) {
return true;
}
if (getName().equals("DB2QP")) {
return true;
}
if (getName().equals("SQLJ")) {
return true;
}
if (getName().equals("NULLID")) {
return true;
}
return false;
return SYSTEM_SCHEMA.contains(name);
}
@Override
......
......@@ -59,6 +59,8 @@ public abstract class DB2TableBase extends JDBCTable<DB2DataSource, DB2Schema> i
private String remarks;
private String fullyQualifiedName;
// -----------------
// Constructors
// -----------------
......@@ -82,6 +84,9 @@ public abstract class DB2TableBase extends JDBCTable<DB2DataSource, DB2Schema> i
this.alterTime = JDBCUtils.safeGetTimestamp(dbResult, "ALTER_TIME");
this.ownerType = CommonUtils.valueOf(DB2OwnerType.class, JDBCUtils.safeGetString(dbResult, "OWNERTYPE"));
}
// Compute this once for all
fullyQualifiedName = DBUtils.getFullQualifiedName(db2DataSource, schema, this);
}
public DB2TableBase(DB2Schema container, String name, Boolean persisted)
......@@ -101,9 +106,7 @@ public abstract class DB2TableBase extends JDBCTable<DB2DataSource, DB2Schema> i
@Override
public String getFullQualifiedName()
{
return DBUtils.getFullQualifiedName(getDataSource(),
getContainer(),
this);
return fullyQualifiedName;
}
// -----------------
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册