Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNan Li2013-11-14 22:16:50 +0000
committerNan Li2013-11-14 22:16:50 +0000
commitf16ae2408cb902ff69a12d72c3cec9d869ee3923 (patch)
tree423089dfec2166fd130d7175287330e41eab41bd
parent6726d38906d7d61e952dfade12c98bda28c8b1e4 (diff)
downloadwebtools.dali-f16ae2408cb902ff69a12d72c3cec9d869ee3923.tar.gz
webtools.dali-f16ae2408cb902ff69a12d72c3cec9d869ee3923.tar.xz
webtools.dali-f16ae2408cb902ff69a12d72c3cec9d869ee3923.zip
Bug 421555 - Schema information not displayed for SQL database
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SimpleCatalogStrategy.java42
1 files changed, 31 insertions, 11 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..e5d7109d19 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;
}
- public boolean supportsCatalogs() {
- return true;
- }
-
@SuppressWarnings("unchecked")
- public List<Catalog> getCatalogs() {
- return this.database.getCatalogs();
- }
-
- public List<Schema> getSchemas() {
- return Collections.emptyList();
- }
+ 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() {
+ 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