提交 28a3ee01 编写于 作者: S Serge Rider

Generic driver: system schema detection + HANA system schemas


Former-commit-id: 7370af67
上级 329b7f96
......@@ -19,6 +19,7 @@ package org.jkiss.dbeaver.ext.generic.model;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.DBPSystemObject;
import org.jkiss.dbeaver.model.meta.Property;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.model.struct.DBSEntity;
......@@ -28,7 +29,7 @@ import org.jkiss.dbeaver.model.struct.rdb.DBSSchema;
/**
* GenericSchema
*/
public class GenericSchema extends GenericObjectContainer implements DBSSchema
public class GenericSchema extends GenericObjectContainer implements DBSSchema, DBPSystemObject
{
@Nullable
private GenericCatalog catalog;
......@@ -89,4 +90,9 @@ public class GenericSchema extends GenericObjectContainer implements DBSSchema
{
return GenericTable.class;
}
@Override
public boolean isSystem() {
return getDataSource().getMetaModel().isSystemSchema(this);
}
}
......@@ -103,6 +103,10 @@ public class GenericMetaModel {
//////////////////////////////////////////////////////
// Schema load
public boolean isSystemSchema(GenericSchema schema) {
return false;
}
public List<GenericSchema> loadSchemas(JDBCSession session, GenericDataSource dataSource, GenericCatalog catalog)
throws DBException
{
......
......@@ -253,15 +253,21 @@ public class HANAMetaModel extends GenericMetaModel
public String getAutoIncrementClause(GenericTableColumn column) {
return "GENERATED ALWAYS AS IDENTITY";
}
@Override
public boolean isSystemSchema(GenericSchema schema) {
String schemaName = schema.getName();
return schemaName.startsWith("_SYS_") ||
schemaName.startsWith("SAP_") ||
schemaName.startsWith("HANA_");
}
@Override
public boolean isSystemTable(GenericTableBase table) {
// empty schemas are still shown, so hiding everything in system schemas looks strange
//if (table.getSchema().getName().startsWith("_SYS_"))
// return true;
if (table.getName().startsWith("_SYS_"))
return true;
return false;
return table.getName().startsWith("_SYS_");
}
@Override
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册