cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skolbac...@apache.org
Subject cayenne git commit: CAY-1994 | Modeler Migration Tool Shows No Changes
Date Tue, 31 Mar 2015 13:56:27 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master f19da189c -> 9777372dc


CAY-1994 | Modeler Migration Tool Shows No Changes


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

Branch: refs/heads/master
Commit: 9777372dc3dc4f0a40994b1fa3ae30783589b866
Parents: f19da18
Author: Savva Kolbachev <s.kolbachev@gmail.com>
Authored: Tue Mar 31 16:49:33 2015 +0300
Committer: Savva Kolbachev <s.kolbachev@gmail.com>
Committed: Tue Mar 31 16:49:33 2015 +0300

----------------------------------------------------------------------
 .../java/org/apache/cayenne/merge/DbMerger.java | 33 +++++++++--------
 docs/doc/src/main/resources/RELEASE-NOTES.txt   |  1 +
 .../modeler/dialog/db/MergerOptions.java        | 39 ++++++++++----------
 3 files changed, 39 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/9777372d/cayenne-server/src/main/java/org/apache/cayenne/merge/DbMerger.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/merge/DbMerger.java b/cayenne-server/src/main/java/org/apache/cayenne/merge/DbMerger.java
index e7ff3ac..6cc1fa3 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/merge/DbMerger.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/merge/DbMerger.java
@@ -18,24 +18,11 @@
  */
 package org.apache.cayenne.merge;
 
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.sql.Types;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-import javax.sql.DataSource;
-
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.access.DataNode;
 import org.apache.cayenne.access.DbLoader;
 import org.apache.cayenne.access.loader.DbLoaderConfiguration;
-import org.apache.cayenne.access.loader.DefaultDbLoaderDelegate;
+import org.apache.cayenne.access.loader.LoggingDbLoaderDelegate;
 import org.apache.cayenne.access.loader.filters.DbPath;
 import org.apache.cayenne.access.loader.filters.FiltersConfig;
 import org.apache.cayenne.dba.DbAdapter;
@@ -46,6 +33,20 @@ import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.DbJoin;
 import org.apache.cayenne.map.DbRelationship;
 import org.apache.cayenne.map.DetectedDbEntity;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.sql.DataSource;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.Types;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
 
 /**
  * Traverse a {@link DataNode} and a {@link DataMap} and create a group of
@@ -55,6 +56,8 @@ import org.apache.cayenne.map.DetectedDbEntity;
  */
 public class DbMerger {
 
+    private static final Log LOGGER = LogFactory.getLog(DbMerger.class);
+
     private final MergerFactory factory;
     
     private final ValueForNullProvider valueForNull;
@@ -122,7 +125,7 @@ public class DbMerger {
         try {
             conn = dataSource.getConnection();
 
-            return new DbLoader(conn, adapter, new DefaultDbLoaderDelegate()).load(config);
+            return new DbLoader(conn, adapter, new LoggingDbLoaderDelegate(LOGGER)).load(config);
         } catch (SQLException e) {
             throw new CayenneRuntimeException("Can't doLoad dataMap from db.", e);
         } finally {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/9777372d/docs/doc/src/main/resources/RELEASE-NOTES.txt
----------------------------------------------------------------------
diff --git a/docs/doc/src/main/resources/RELEASE-NOTES.txt b/docs/doc/src/main/resources/RELEASE-NOTES.txt
index 00f132d..1b87fa7 100644
--- a/docs/doc/src/main/resources/RELEASE-NOTES.txt
+++ b/docs/doc/src/main/resources/RELEASE-NOTES.txt
@@ -22,6 +22,7 @@ Bug Fixes:
 CAY-1987 Widen types before performing in-memory evaluation of qualifiers using j.l.Number
subclasses
 CAY-1990 Incorrect display of the raw SQL query in Modeler
 CAY-1993 Reverse Engineering does not work with PostgreSQL database
+CAY-1994 Modeler Migration Tool Shows No Changes
 
 ----------------------------------
 Release: 4.0.M2

http://git-wip-us.apache.org/repos/asf/cayenne/blob/9777372d/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerOptions.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerOptions.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerOptions.java
index dc05932..8684f28 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerOptions.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerOptions.java
@@ -19,25 +19,7 @@
 
 package org.apache.cayenne.modeler.dialog.db;
 
-import java.awt.Component;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.sql.DataSource;
-import javax.swing.JFileChooser;
-import javax.swing.JOptionPane;
-import javax.swing.WindowConstants;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-
 import org.apache.cayenne.access.loader.DbLoaderConfiguration;
-import org.apache.cayenne.access.loader.filters.DbPath;
-import org.apache.cayenne.access.loader.filters.EntityFilters;
-import org.apache.cayenne.access.loader.filters.FiltersConfig;
 import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.configuration.DataNodeDescriptor;
 import org.apache.cayenne.dba.JdbcAdapter;
@@ -68,8 +50,25 @@ import org.apache.cayenne.project.Project;
 import org.apache.cayenne.resource.Resource;
 import org.apache.cayenne.swing.BindingBuilder;
 import org.apache.cayenne.swing.ObjectBinding;
+import org.apache.cayenne.tools.dbimport.config.FiltersConfigBuilder;
+import org.apache.cayenne.tools.dbimport.config.ReverseEngineering;
+import org.apache.cayenne.tools.dbimport.config.Schema;
 import org.apache.cayenne.validation.ValidationResult;
 
+import javax.sql.DataSource;
+import javax.swing.JFileChooser;
+import javax.swing.JOptionPane;
+import javax.swing.WindowConstants;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import java.awt.Component;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Iterator;
+import java.util.List;
+
 public class MergerOptions extends CayenneController {
 
     protected MergerOptionsView view;
@@ -170,7 +169,9 @@ public class MergerOptions extends CayenneController {
             merger = new DbMerger(adapter.mergerFactory());
 
             DbLoaderConfiguration config = new DbLoaderConfiguration();
-            config.setFiltersConfig(new FiltersConfig(new EntityFilters(new DbPath(null,
defaultSchema))));
+            ReverseEngineering engineering = new ReverseEngineering();
+            engineering.addSchema(new Schema(defaultSchema));
+            config.setFiltersConfig(new FiltersConfigBuilder(engineering).filtersConfig());
 
             List<MergerToken> mergerTokens = merger.createMergeTokens(
                     connectionInfo.makeDataSource(getApplication().getClassLoadingService()),


Mime
View raw message