Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornhauge2010-10-19 12:40:13 -0400
committernhauge2010-10-19 12:40:13 -0400
commite3e1e581b07b770b459e01196d7bc45bad2c3484 (patch)
tree5ef8bb36faa664b8547320467a78be79965eb413
parent719bf5fcdd56acefa2e03eafc5d539c49259909e (diff)
downloadwebtools.dali-e3e1e581b07b770b459e01196d7bc45bad2c3484.tar.gz
webtools.dali-e3e1e581b07b770b459e01196d7bc45bad2c3484.tar.xz
webtools.dali-e3e1e581b07b770b459e01196d7bc45bad2c3484.zip
[327572] Unfortunately DTP allows for optional support of catalogs in extensions.
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/SimpleCatalogStrategy.java26
1 files changed, 25 insertions, 1 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/SimpleCatalogStrategy.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/SimpleCatalogStrategy.java
index 8a1a04129e..d3e6b78194 100644
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/SimpleCatalogStrategy.java
+++ b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/SimpleCatalogStrategy.java
@@ -41,16 +41,40 @@ class SimpleCatalogStrategy
super();
}
+ @SuppressWarnings("unchecked")
public boolean supportsCatalogs(Database database) {
+ // Bug 327572 - Unfortunately DTP allows for optional support of catalogs in extensions
+ List<Catalog> catalogs = database.getCatalogs();
+ if ((catalogs == null) || catalogs.isEmpty()) {
+ return false;
+ }
+
+ // normal logic:
return true;
}
@SuppressWarnings("unchecked")
public List<Catalog> getCatalogs(Database database) {
- return database.getCatalogs();
+ List<Catalog> catalogs = database.getCatalogs();
+ // Bug 327572 - Unfortunately DTP allows for optional support of catalogs in extensions
+ if ((catalogs == null) || catalogs.isEmpty()) {
+ return Collections.emptyList();
+ }
+
+ // normal logic:
+ return catalogs;
}
+ @SuppressWarnings("unchecked")
public List<Schema> getSchemas(Database database) {
+ List<Catalog> catalogs = database.getCatalogs();
+ // Bug 327572 - Unfortunately DTP allows for optional support of catalogs in extensions
+ // if there are no catalogs, the database must hold the schemata directly
+ if ((catalogs == null) || catalogs.isEmpty()) {
+ return database.getSchemas();
+ }
+
+ // normal logic:
return Collections.emptyList();
}

Back to the top