Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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..4b46a6c044 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: 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: 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: 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