Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNan Li2013-11-14 22:50:29 +0000
committerNan Li2013-11-14 22:50:29 +0000
commitec709cad52671c4042df918f1eed6e7b5711dcde (patch)
tree93438a277ab708eccb85569d83adfb6020277b67 /jpa/plugins
parent5a262561ab906c702e812230e7862b06ca8bfdf2 (diff)
downloadwebtools.dali-ec709cad52671c4042df918f1eed6e7b5711dcde.tar.gz
webtools.dali-ec709cad52671c4042df918f1eed6e7b5711dcde.tar.xz
webtools.dali-ec709cad52671c4042df918f1eed6e7b5711dcde.zip
Bug 421555 - Schema information not displayed for SQL database
Diffstat (limited to 'jpa/plugins')
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SimpleCatalogStrategy.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SimpleCatalogStrategy.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SimpleCatalogStrategy.java
index 8d42d07226..9013351929 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SimpleCatalogStrategy.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SimpleCatalogStrategy.java
@@ -31,16 +31,36 @@ class SimpleCatalogStrategy
this.database = database;
}
+ @SuppressWarnings("unchecked")
public boolean supportsCatalogs() {
+ // DTP allows for optional support of catalogs in extensions
+ List<Catalog> catalogs = this.database.getCatalogs();
+ if ((catalogs == null) || catalogs.isEmpty()) {
+ return false;
+ }
+
return true;
}
@SuppressWarnings("unchecked")
public List<Catalog> getCatalogs() {
- return this.database.getCatalogs();
+ List<Catalog> catalogs = this.database.getCatalogs();
+ // DTP allows for optional support of catalogs in extensions
+ if ((catalogs == null) || catalogs.isEmpty()) {
+ return Collections.emptyList();
+ }
+
+ return catalogs;
}
+ @SuppressWarnings("unchecked")
public List<Schema> getSchemas() {
+ List<Catalog> catalogs = this.database.getCatalogs();
+ // if there are no catalogs, the database must hold the schemata directly
+ if ((catalogs == null) || catalogs.isEmpty()) {
+ return this.database.getSchemas();
+ }
+
return Collections.emptyList();
}
}

Back to the top