Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNan Li2013-11-14 17:37:54 -0500
committerNan Li2013-11-14 17:40:23 -0500
commite6bdf574bfe1a5616a879b66bf8ea771316a40b4 (patch)
tree0585deae06f63870dfcc4b6d65d5a22d7fb53d49
parent3ffb1ac14aef00a3d206864621b6c48335b61cc2 (diff)
downloadwebtools.dali-201311210236.tar.gz
webtools.dali-201311210236.tar.xz
webtools.dali-201311210236.zip
Bug 421555 - Schema information not displayed for SQL databasev201311210236
-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