diff options
author | nhauge | 2010-10-19 16:07:14 +0000 |
---|---|---|
committer | nhauge | 2010-10-19 16:07:14 +0000 |
commit | 27b85dc106de81f3d15b068b534f4d1dad8eafda (patch) | |
tree | 9cab7af4e8730a6809a00c7b79e2bb12a44e2c1e | |
parent | 8fae83e50cfa3fa1f07dbeaff54bed99885a80bf (diff) | |
download | webtools.dali-27b85dc106de81f3d15b068b534f4d1dad8eafda.tar.gz webtools.dali-27b85dc106de81f3d15b068b534f4d1dad8eafda.tar.xz webtools.dali-27b85dc106de81f3d15b068b534f4d1dad8eafda.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.java | 26 |
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(); } |