cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skolbac...@apache.org
Subject [1/3] cayenne git commit: CAY-2151 Migrate Database Schema: issue when no db is specified skip catalog check if DbAdapter doesn't support catalogs in metadata
Date Wed, 30 Nov 2016 08:26:25 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 66d44c2d2 -> 52acbefcb


CAY-2151 Migrate Database Schema: issue when no db is specified
skip catalog check if DbAdapter doesn't support catalogs in metadata


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/ba17f227
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/ba17f227
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/ba17f227

Branch: refs/heads/master
Commit: ba17f227291ce451be1732f8863a8332aa1b63d3
Parents: 1bbc93e
Author: Nikita Timofeev <stariy95@gmail.com>
Authored: Mon Nov 28 12:36:52 2016 +0300
Committer: Savva Kolbachev <s.kolbachev@gmail.com>
Committed: Tue Nov 29 18:30:28 2016 +0300

----------------------------------------------------------------------
 .../org/apache/cayenne/modeler/action/MigrateAction.java    | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/ba17f227/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/MigrateAction.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/MigrateAction.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/MigrateAction.java
index 5f10f09..00e27bf 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/MigrateAction.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/MigrateAction.java
@@ -32,6 +32,7 @@ import org.apache.cayenne.modeler.pref.DBConnectionInfo;
 import javax.sql.DataSource;
 import javax.swing.*;
 import java.awt.event.ActionEvent;
+import java.util.Collections;
 import java.util.List;
 
 /**
@@ -105,10 +106,16 @@ public class MigrateAction extends DBWizardAction {
                 map, selectedCatalog, selectedSchema, mergerTokenFactoryProvider).startupAction();
     }
 
+    @SuppressWarnings("unchecked")
     private List<String> getCatalogs(DataSourceController connectWizard) throws Exception
{
+        DbAdapter adapter = connectWizard.getConnectionInfo()
+                .makeAdapter(getApplication().getClassLoadingService());
+        if(!adapter.supportsCatalogsOnReverseEngineering()) {
+            return (List<String>)Collections.EMPTY_LIST;
+        }
+
         DataSource dataSource = connectWizard.getConnectionInfo()
                 .makeDataSource(getApplication().getClassLoadingService());
-
         return DbLoader.loadCatalogs(dataSource.getConnection());
     }
 


Mime
View raw message