cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject [01/16] cayenne git commit: New DbMerger for dbsync utils - merger process split in independent steps - new attributes compared (full type comparision of DbAttribute)
Date Wed, 14 Dec 2016 19:12:37 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master e187caa43 -> 25ae44a20


http://git-wip-us.apache.org/repos/asf/cayenne/blob/46c8ded5/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/DbMergerTest.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/DbMergerTest.java
b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/DbMergerTest.java
index 55e1e4a..821f254 100644
--- a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/DbMergerTest.java
+++ b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/DbMergerTest.java
@@ -20,11 +20,12 @@ package org.apache.cayenne.dbsync.merge;
 
 import org.apache.cayenne.dbsync.merge.builders.DbEntityBuilder;
 import org.apache.cayenne.dbsync.merge.factory.HSQLMergerTokenFactory;
+import org.apache.cayenne.dbsync.merge.token.MergerToken;
+import org.apache.cayenne.dbsync.merge.token.SetColumnTypeToDb;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.DbEntity;
 import org.junit.Test;
 
-import java.util.ArrayList;
 import java.util.List;
 
 import static org.apache.cayenne.dbsync.merge.builders.ObjectMother.dataMap;
@@ -37,7 +38,9 @@ public class DbMergerTest {
 
     @Test
     public void testEmptyDataMap() throws Exception {
-        assertEquals(0, dbMerger().createMergeTokens(new ArrayList<DbEntity>(0), new
ArrayList<DbEntity>(0)).size());
+        DataMap existing = dataMap().build();
+        DataMap db = dataMap().build();
+        assertEquals(0, dbMerger().createMergeTokens(existing, db).size());
     }
 
     @Test
@@ -47,8 +50,9 @@ public class DbMergerTest {
                 dbAttr("attr01").typeInt()
         );
         DataMap existing = dataMap().with(dbEntity).build();
+        DataMap db = dataMap().build();
 
-        List<MergerToken> tokens = dbMerger().createMergeTokens(existing.getDbEntities(),
new ArrayList<DbEntity>(0));
+        List<MergerToken> tokens = dbMerger().createMergeTokens(existing, db);
 
         assertEquals(1, tokens.size());
         assertEquals(factory().createCreateTableToDb(dbEntity.build()).getTokenValue(),
@@ -57,12 +61,13 @@ public class DbMergerTest {
 
     @Test
     public void testRemoveTable() throws Exception {
+        DataMap existing = dataMap().build();
         DataMap db = dataMap().with(
             dbEntity("table1").attributes(
                 dbAttr("attr01").typeInt()
         )).build();
 
-        List<MergerToken> tokens = dbMerger().createMergeTokens(new ArrayList<DbEntity>(0),
db.getDbEntities());
+        List<MergerToken> tokens = dbMerger().createMergeTokens(existing, db);
 
         assertEquals(1, tokens.size());
         assertEquals(factory().createDropTableToDb(db.getDbEntity("table1")).getTokenValue(),
@@ -82,7 +87,7 @@ public class DbMergerTest {
                 dbAttr("attr01").typeInt()
         )).build();
 
-        List<MergerToken> tokens = dbMerger().createMergeTokens(existing.getDbEntities(),
db.getDbEntities());
+        List<MergerToken> tokens = dbMerger().createMergeTokens(existing, db);
 
         assertEquals(1, tokens.size());
 
@@ -103,7 +108,7 @@ public class DbMergerTest {
                         dbAttr("attr01").typeVarchar(30)
                 )).build();
 
-        List<MergerToken> tokens = dbMerger().createMergeTokens(existing.getDbEntities(),
db.getDbEntities());
+        List<MergerToken> tokens = dbMerger().createMergeTokens(existing, db);
         assertEquals(1, tokens.size());
 
         DbEntity entity = existing.getDbEntity("table1");
@@ -131,7 +136,7 @@ public class DbMergerTest {
                         dbAttr("attr01").typeVarchar(30)
                 )).build();
 
-        List<MergerToken> tokens = dbMerger().createMergeTokens(existing.getDbEntities(),
db.getDbEntities());
+        List<MergerToken> tokens = dbMerger().createMergeTokens(existing, db);
         assertEquals(1, tokens.size());
 
         DbEntity entity = existing.getDbEntity("table1");
@@ -168,7 +173,7 @@ public class DbMergerTest {
                         dbAttr("attr04").type("TIMESTAMP")
                 )).build();
 
-        List<MergerToken> tokens = dbMerger().createMergeTokens(existing.getDbEntities(),
db.getDbEntities());
+        List<MergerToken> tokens = dbMerger().createMergeTokens(existing, db);
         assertEquals(0, tokens.size());
     }
 
@@ -197,7 +202,7 @@ public class DbMergerTest {
          .build();
 
 
-        List<MergerToken> tokens = dbMerger().createMergeTokens(existing.getDbEntities(),
db.getDbEntities());
+        List<MergerToken> tokens = dbMerger().createMergeTokens(existing, db);
 
         assertEquals(1, tokens.size());
 
@@ -235,7 +240,7 @@ public class DbMergerTest {
          .build();
 
 
-        List<MergerToken> tokens = dbMerger().createMergeTokens(existing.getDbEntities(),
db.getDbEntities());
+        List<MergerToken> tokens = dbMerger().createMergeTokens(existing, db);
 
         assertEquals(2, tokens.size());
 
@@ -273,7 +278,7 @@ public class DbMergerTest {
          .build();
 
 
-        List<MergerToken> tokens = dbMerger().createMergeTokens(existing.getDbEntities(),
db.getDbEntities());
+        List<MergerToken> tokens = dbMerger().createMergeTokens(existing, db);
 
         assertEquals(1, tokens.size());
 
@@ -295,7 +300,7 @@ public class DbMergerTest {
                 dbAttr("attr02").typeInt()
         )).build();
 
-        List<MergerToken> tokens = dbMerger().createMergeTokens(existing.getDbEntities(),
db.getDbEntities());
+        List<MergerToken> tokens = dbMerger().createMergeTokens(existing, db);
 
         assertEquals(1, tokens.size());
 
@@ -321,11 +326,11 @@ public class DbMergerTest {
         )).build();
 
 
-        assertEquals(0, dbMerger().createMergeTokens(dataMap1.getDbEntities(), dataMap2.getDbEntities()).size());
+        assertEquals(0, dbMerger().createMergeTokens(dataMap1, dataMap2).size());
     }
 
-    private DbMerger dbMerger() {
-        return DbMerger.build(factory());
+    private DataMapMerger dbMerger() {
+        return DataMapMerger.build(factory());
     }
 
     private HSQLMergerTokenFactory factory() {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/46c8ded5/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/DropColumnToModelIT.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/DropColumnToModelIT.java
b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/DropColumnToModelIT.java
index f6e0675..b0a23a7 100644
--- a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/DropColumnToModelIT.java
+++ b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/DropColumnToModelIT.java
@@ -28,6 +28,9 @@ import static org.junit.Assert.fail;
 import java.sql.Types;
 import java.util.List;
 
+import org.apache.cayenne.dbsync.merge.token.DropColumnToModel;
+import org.apache.cayenne.dbsync.merge.token.DropRelationshipToModel;
+import org.apache.cayenne.dbsync.merge.token.MergerToken;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.DbJoin;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/46c8ded5/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/DropRelationshipToModelIT.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/DropRelationshipToModelIT.java
b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/DropRelationshipToModelIT.java
index 4981581..d2ac514 100644
--- a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/DropRelationshipToModelIT.java
+++ b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/DropRelationshipToModelIT.java
@@ -27,6 +27,9 @@ import static org.junit.Assert.fail;
 import java.sql.Types;
 import java.util.List;
 
+import org.apache.cayenne.dbsync.merge.token.DropColumnToModel;
+import org.apache.cayenne.dbsync.merge.token.DropRelationshipToModel;
+import org.apache.cayenne.dbsync.merge.token.MergerToken;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.DbJoin;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/46c8ded5/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/DropTableToModelIT.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/DropTableToModelIT.java
b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/DropTableToModelIT.java
index 5b1744a..63e0047 100644
--- a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/DropTableToModelIT.java
+++ b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/DropTableToModelIT.java
@@ -26,6 +26,8 @@ import static org.junit.Assert.assertTrue;
 import java.sql.Types;
 import java.util.List;
 
+import org.apache.cayenne.dbsync.merge.token.DropTableToModel;
+import org.apache.cayenne.dbsync.merge.token.MergerToken;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.ObjAttribute;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/46c8ded5/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/EntityMergeSupportIT.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/EntityMergeSupportIT.java
b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/EntityMergeSupportIT.java
index 30e1a4b..82d567e 100644
--- a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/EntityMergeSupportIT.java
+++ b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/EntityMergeSupportIT.java
@@ -19,6 +19,7 @@
 package org.apache.cayenne.dbsync.merge;
 
 import org.apache.cayenne.dbsync.filter.NamePatternMatcher;
+import org.apache.cayenne.dbsync.merge.context.EntityMergeSupport;
 import org.apache.cayenne.dbsync.naming.DefaultObjectNameGenerator;
 import org.apache.cayenne.dbsync.naming.NoStemStemmer;
 import org.apache.cayenne.map.DbAttribute;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/46c8ded5/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/MergeCase.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/MergeCase.java b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/MergeCase.java
index 63e7563..08eae3c 100644
--- a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/MergeCase.java
+++ b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/MergeCase.java
@@ -22,8 +22,11 @@ import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.access.DataNode;
 import org.apache.cayenne.configuration.server.ServerRuntime;
 import org.apache.cayenne.dba.DbAdapter;
+import org.apache.cayenne.dbsync.merge.context.MergerContext;
 import org.apache.cayenne.dbsync.merge.factory.MergerTokenFactory;
 import org.apache.cayenne.dbsync.merge.factory.MergerTokenFactoryProvider;
+import org.apache.cayenne.dbsync.merge.token.AbstractToDbToken;
+import org.apache.cayenne.dbsync.merge.token.MergerToken;
 import org.apache.cayenne.dbsync.naming.DefaultObjectNameGenerator;
 import org.apache.cayenne.dbsync.naming.NoStemStemmer;
 import org.apache.cayenne.dbsync.reverse.db.DbLoader;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/46c8ded5/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/TokenComparatorTest.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/TokenComparatorTest.java
b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/TokenComparatorTest.java
index 06adb75..edb43fa 100644
--- a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/TokenComparatorTest.java
+++ b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/TokenComparatorTest.java
@@ -24,6 +24,20 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
+import org.apache.cayenne.dbsync.merge.token.AddColumnToDb;
+import org.apache.cayenne.dbsync.merge.token.AddColumnToModel;
+import org.apache.cayenne.dbsync.merge.token.AddRelationshipToDb;
+import org.apache.cayenne.dbsync.merge.token.AddRelationshipToModel;
+import org.apache.cayenne.dbsync.merge.token.CreateTableToDb;
+import org.apache.cayenne.dbsync.merge.token.CreateTableToModel;
+import org.apache.cayenne.dbsync.merge.token.DropColumnToDb;
+import org.apache.cayenne.dbsync.merge.token.DropColumnToModel;
+import org.apache.cayenne.dbsync.merge.token.DropRelationshipToDb;
+import org.apache.cayenne.dbsync.merge.token.DropRelationshipToModel;
+import org.apache.cayenne.dbsync.merge.token.DropTableToDb;
+import org.apache.cayenne.dbsync.merge.token.DropTableToModel;
+import org.apache.cayenne.dbsync.merge.token.MergerToken;
+import org.apache.cayenne.dbsync.merge.token.TokenComparator;
 import org.junit.Before;
 import org.junit.Test;
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/46c8ded5/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/TokensReverseTest.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/TokensReverseTest.java
b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/TokensReverseTest.java
index bde6c88..da1ce9d 100644
--- a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/TokensReverseTest.java
+++ b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/TokensReverseTest.java
@@ -20,6 +20,8 @@ package org.apache.cayenne.dbsync.merge;
 
 import org.apache.cayenne.dbsync.merge.factory.HSQLMergerTokenFactory;
 import org.apache.cayenne.dbsync.merge.factory.MergerTokenFactory;
+import org.apache.cayenne.dbsync.merge.token.DefaultValueForNullProvider;
+import org.apache.cayenne.dbsync.merge.token.MergerToken;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.DbJoin;
@@ -27,7 +29,6 @@ import org.apache.cayenne.map.DbRelationship;
 import org.junit.Assert;
 import org.junit.Test;
 
-import java.util.Collection;
 import java.util.Collections;
 
 import static org.apache.cayenne.dbsync.merge.builders.ObjectMother.dbAttr;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/46c8ded5/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/TokensToModelExecutionTest.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/TokensToModelExecutionTest.java
b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/TokensToModelExecutionTest.java
index b9abea1..fde39c3 100644
--- a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/TokensToModelExecutionTest.java
+++ b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/TokensToModelExecutionTest.java
@@ -19,6 +19,7 @@
 package org.apache.cayenne.dbsync.merge;
 
 import org.apache.cayenne.access.DataNode;
+import org.apache.cayenne.dbsync.merge.context.MergerContext;
 import org.apache.cayenne.dbsync.merge.factory.DefaultMergerTokenFactory;
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.DbAttribute;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/46c8ded5/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/ValueForNullIT.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/ValueForNullIT.java
b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/ValueForNullIT.java
index c88b601..03a572b 100644
--- a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/ValueForNullIT.java
+++ b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/ValueForNullIT.java
@@ -23,6 +23,7 @@ import org.apache.cayenne.DataObject;
 import org.apache.cayenne.Persistent;
 import org.apache.cayenne.access.DataContext;
 import org.apache.cayenne.access.jdbc.SQLParameterBinding;
+import org.apache.cayenne.dbsync.merge.token.DefaultValueForNullProvider;
 import org.apache.cayenne.di.Inject;
 import org.apache.cayenne.exp.Expression;
 import org.apache.cayenne.exp.ExpressionFactory;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/46c8ded5/cayenne-server/src/main/java/org/apache/cayenne/map/DbEntity.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/map/DbEntity.java b/cayenne-server/src/main/java/org/apache/cayenne/map/DbEntity.java
index 376cb07..b119254 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/map/DbEntity.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/map/DbEntity.java
@@ -155,8 +155,8 @@ public class DbEntity extends Entity implements ConfigurationNode, DbEntityListe
      * present.
      */
     public String getFullyQualifiedName() {
-        return (catalog != null ? catalog + '.' : "")
-             + (schema != null ? schema + '.' : "")
+        return ((catalog != null && !catalog.isEmpty()) ? catalog + '.' : "")
+             + ((schema != null && !schema.isEmpty()) ? schema + '.' : "")
              + name;
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/46c8ded5/cayenne-tools/src/main/java/org/apache/cayenne/tools/dbimport/DbImportConfiguration.java
----------------------------------------------------------------------
diff --git a/cayenne-tools/src/main/java/org/apache/cayenne/tools/dbimport/DbImportConfiguration.java
b/cayenne-tools/src/main/java/org/apache/cayenne/tools/dbimport/DbImportConfiguration.java
index 681d353..453778c 100644
--- a/cayenne-tools/src/main/java/org/apache/cayenne/tools/dbimport/DbImportConfiguration.java
+++ b/cayenne-tools/src/main/java/org/apache/cayenne/tools/dbimport/DbImportConfiguration.java
@@ -24,8 +24,8 @@ import org.apache.cayenne.conn.DataSourceInfo;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dbsync.filter.NameFilter;
 import org.apache.cayenne.dbsync.filter.NamePatternMatcher;
-import org.apache.cayenne.dbsync.merge.DefaultModelMergeDelegate;
-import org.apache.cayenne.dbsync.merge.ModelMergeDelegate;
+import org.apache.cayenne.dbsync.reverse.dbload.DefaultModelMergeDelegate;
+import org.apache.cayenne.dbsync.reverse.dbload.ModelMergeDelegate;
 import org.apache.cayenne.dbsync.naming.DbEntityNameStemmer;
 import org.apache.cayenne.dbsync.naming.DefaultObjectNameGenerator;
 import org.apache.cayenne.dbsync.naming.NoStemStemmer;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/46c8ded5/cayenne-tools/src/main/java/org/apache/cayenne/tools/dbimport/DefaultDbImportAction.java
----------------------------------------------------------------------
diff --git a/cayenne-tools/src/main/java/org/apache/cayenne/tools/dbimport/DefaultDbImportAction.java
b/cayenne-tools/src/main/java/org/apache/cayenne/tools/dbimport/DefaultDbImportAction.java
index 331a155..7314549 100644
--- a/cayenne-tools/src/main/java/org/apache/cayenne/tools/dbimport/DefaultDbImportAction.java
+++ b/cayenne-tools/src/main/java/org/apache/cayenne/tools/dbimport/DefaultDbImportAction.java
@@ -24,13 +24,13 @@ import org.apache.cayenne.configuration.server.DataSourceFactory;
 import org.apache.cayenne.configuration.server.DbAdapterFactory;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dbsync.filter.NameFilter;
-import org.apache.cayenne.dbsync.merge.AbstractToModelToken;
-import org.apache.cayenne.dbsync.merge.DbMerger;
-import org.apache.cayenne.dbsync.merge.MergerContext;
-import org.apache.cayenne.dbsync.merge.MergerToken;
-import org.apache.cayenne.dbsync.merge.ModelMergeDelegate;
-import org.apache.cayenne.dbsync.merge.ProxyModelMergeDelegate;
-import org.apache.cayenne.dbsync.merge.TokenComparator;
+import org.apache.cayenne.dbsync.merge.token.AbstractToModelToken;
+import org.apache.cayenne.dbsync.merge.DataMapMerger;
+import org.apache.cayenne.dbsync.merge.context.MergerContext;
+import org.apache.cayenne.dbsync.merge.token.MergerToken;
+import org.apache.cayenne.dbsync.reverse.dbload.ModelMergeDelegate;
+import org.apache.cayenne.dbsync.reverse.dbload.ProxyModelMergeDelegate;
+import org.apache.cayenne.dbsync.merge.token.TokenComparator;
 import org.apache.cayenne.dbsync.merge.factory.MergerTokenFactory;
 import org.apache.cayenne.dbsync.merge.factory.MergerTokenFactoryProvider;
 import org.apache.cayenne.dbsync.naming.ObjectNameGenerator;
@@ -164,7 +164,7 @@ public class DefaultDbImportAction implements DbImportAction {
         MergerTokenFactory mergerTokenFactory = mergerTokenFactoryProvider.get(adapter);
 
         DbLoaderConfiguration loaderConfig = config.getDbLoaderConfig();
-        List<MergerToken> tokens = DbMerger.builder(mergerTokenFactory)
+        List<MergerToken> tokens = DataMapMerger.builder(mergerTokenFactory)
                 .filters(loaderConfig.getFiltersConfig())
                 .skipPKTokens(loaderConfig.isSkipPrimaryKeyLoading())
                 .skipRelationshipsTokens(loaderConfig.isSkipRelationshipsLoading())

http://git-wip-us.apache.org/repos/asf/cayenne/blob/46c8ded5/cayenne-tools/src/test/java/org/apache/cayenne/tools/dbimport/DefaultDbImportActionTest.java
----------------------------------------------------------------------
diff --git a/cayenne-tools/src/test/java/org/apache/cayenne/tools/dbimport/DefaultDbImportActionTest.java
b/cayenne-tools/src/test/java/org/apache/cayenne/tools/dbimport/DefaultDbImportActionTest.java
index aa635b2..9dcdd27 100644
--- a/cayenne-tools/src/test/java/org/apache/cayenne/tools/dbimport/DefaultDbImportActionTest.java
+++ b/cayenne-tools/src/test/java/org/apache/cayenne/tools/dbimport/DefaultDbImportActionTest.java
@@ -25,12 +25,12 @@ import org.apache.cayenne.configuration.server.DbAdapterFactory;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dbsync.DbSyncModule;
 import org.apache.cayenne.dbsync.filter.NamePatternMatcher;
-import org.apache.cayenne.dbsync.merge.AddColumnToModel;
-import org.apache.cayenne.dbsync.merge.AddRelationshipToModel;
-import org.apache.cayenne.dbsync.merge.CreateTableToDb;
-import org.apache.cayenne.dbsync.merge.CreateTableToModel;
-import org.apache.cayenne.dbsync.merge.DefaultModelMergeDelegate;
-import org.apache.cayenne.dbsync.merge.MergerToken;
+import org.apache.cayenne.dbsync.merge.token.AddColumnToModel;
+import org.apache.cayenne.dbsync.merge.token.AddRelationshipToModel;
+import org.apache.cayenne.dbsync.merge.token.CreateTableToDb;
+import org.apache.cayenne.dbsync.merge.token.CreateTableToModel;
+import org.apache.cayenne.dbsync.reverse.dbload.DefaultModelMergeDelegate;
+import org.apache.cayenne.dbsync.merge.token.MergerToken;
 import org.apache.cayenne.dbsync.merge.builders.DataMapBuilder;
 import org.apache.cayenne.dbsync.merge.factory.DefaultMergerTokenFactory;
 import org.apache.cayenne.dbsync.merge.factory.MergerTokenFactoryProvider;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/46c8ded5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateObjEntityAction.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateObjEntityAction.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateObjEntityAction.java
index 49940df..068bd7c 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateObjEntityAction.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/CreateObjEntityAction.java
@@ -21,7 +21,7 @@ package org.apache.cayenne.modeler.action;
 import org.apache.cayenne.configuration.ConfigurationNode;
 import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.dbsync.filter.NamePatternMatcher;
-import org.apache.cayenne.dbsync.merge.EntityMergeSupport;
+import org.apache.cayenne.dbsync.merge.context.EntityMergeSupport;
 import org.apache.cayenne.dbsync.naming.DefaultObjectNameGenerator;
 import org.apache.cayenne.dbsync.naming.NameBuilder;
 import org.apache.cayenne.dbsync.naming.NoStemStemmer;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/46c8ded5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/DbEntitySyncAction.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/DbEntitySyncAction.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/DbEntitySyncAction.java
index 9fec428..cf4d2de 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/DbEntitySyncAction.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/DbEntitySyncAction.java
@@ -20,7 +20,7 @@
 package org.apache.cayenne.modeler.action;
 
 import org.apache.cayenne.configuration.DataChannelDescriptor;
-import org.apache.cayenne.dbsync.merge.EntityMergeSupport;
+import org.apache.cayenne.dbsync.merge.context.EntityMergeSupport;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.map.event.EntityEvent;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/46c8ded5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ObjEntitySyncAction.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ObjEntitySyncAction.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ObjEntitySyncAction.java
index 756d7fa..c153a5b 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ObjEntitySyncAction.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/action/ObjEntitySyncAction.java
@@ -20,7 +20,7 @@
 package org.apache.cayenne.modeler.action;
 
 import org.apache.cayenne.configuration.DataChannelDescriptor;
-import org.apache.cayenne.dbsync.merge.EntityMergeSupport;
+import org.apache.cayenne.dbsync.merge.context.EntityMergeSupport;
 import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.map.event.EntityEvent;
 import org.apache.cayenne.map.event.MapEvent;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/46c8ded5/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 52a3666..ec72c4d 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
@@ -22,14 +22,14 @@ package org.apache.cayenne.modeler.dialog.db;
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.configuration.event.DataMapEvent;
 import org.apache.cayenne.dba.DbAdapter;
-import org.apache.cayenne.dbsync.merge.AbstractToDbToken;
-import org.apache.cayenne.dbsync.merge.DbMerger;
-import org.apache.cayenne.dbsync.merge.DefaultModelMergeDelegate;
-import org.apache.cayenne.dbsync.merge.MergeDirection;
-import org.apache.cayenne.dbsync.merge.MergerContext;
-import org.apache.cayenne.dbsync.merge.MergerToken;
-import org.apache.cayenne.dbsync.merge.ModelMergeDelegate;
-import org.apache.cayenne.dbsync.merge.ProxyModelMergeDelegate;
+import org.apache.cayenne.dbsync.merge.token.AbstractToDbToken;
+import org.apache.cayenne.dbsync.merge.DataMapMerger;
+import org.apache.cayenne.dbsync.reverse.dbload.DefaultModelMergeDelegate;
+import org.apache.cayenne.dbsync.merge.context.MergeDirection;
+import org.apache.cayenne.dbsync.merge.context.MergerContext;
+import org.apache.cayenne.dbsync.merge.token.MergerToken;
+import org.apache.cayenne.dbsync.reverse.dbload.ModelMergeDelegate;
+import org.apache.cayenne.dbsync.reverse.dbload.ProxyModelMergeDelegate;
 import org.apache.cayenne.dbsync.merge.factory.MergerTokenFactory;
 import org.apache.cayenne.dbsync.merge.factory.MergerTokenFactoryProvider;
 import org.apache.cayenne.dbsync.naming.DefaultObjectNameGenerator;
@@ -160,7 +160,7 @@ public class MergerOptions extends CayenneController {
             FiltersConfig filters = FiltersConfig.create(defaultCatalog, defaultSchema, TableFilter.everything(),
                     PatternFilter.INCLUDE_NOTHING);
 
-            DbMerger merger = DbMerger.builder(mergerTokenFactory)
+            DataMapMerger merger = DataMapMerger.builder(mergerTokenFactory)
                     .filters(filters)
                     .build();
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/46c8ded5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerTokenSelectorController.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerTokenSelectorController.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerTokenSelectorController.java
index 666b113..20e31e3 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerTokenSelectorController.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerTokenSelectorController.java
@@ -18,9 +18,9 @@
  ****************************************************************/
 package org.apache.cayenne.modeler.dialog.db;
 
-import org.apache.cayenne.dbsync.merge.MergeDirection;
-import org.apache.cayenne.dbsync.merge.MergerToken;
-import org.apache.cayenne.dbsync.merge.TokenComparator;
+import org.apache.cayenne.dbsync.merge.context.MergeDirection;
+import org.apache.cayenne.dbsync.merge.token.MergerToken;
+import org.apache.cayenne.dbsync.merge.token.TokenComparator;
 import org.apache.cayenne.dbsync.merge.factory.MergerTokenFactory;
 import org.apache.cayenne.modeler.Application;
 import org.apache.cayenne.modeler.util.CayenneController;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/46c8ded5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerTokenTableModel.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerTokenTableModel.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerTokenTableModel.java
index 488b1e8..445fe0d 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerTokenTableModel.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/MergerTokenTableModel.java
@@ -18,8 +18,8 @@
  ****************************************************************/
 package org.apache.cayenne.modeler.dialog.db;
 
-import org.apache.cayenne.dbsync.merge.MergeDirection;
-import org.apache.cayenne.dbsync.merge.MergerToken;
+import org.apache.cayenne.dbsync.merge.context.MergeDirection;
+import org.apache.cayenne.dbsync.merge.token.MergerToken;
 
 import javax.swing.table.AbstractTableModel;
 import java.util.List;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/46c8ded5/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/EntitySyncController.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/EntitySyncController.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/EntitySyncController.java
index f13a5b9..e7134d0 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/EntitySyncController.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/EntitySyncController.java
@@ -20,7 +20,7 @@
 package org.apache.cayenne.modeler.dialog.objentity;
 
 import org.apache.cayenne.dbsync.filter.NamePatternMatcher;
-import org.apache.cayenne.dbsync.merge.EntityMergeSupport;
+import org.apache.cayenne.dbsync.merge.context.EntityMergeSupport;
 import org.apache.cayenne.dbsync.naming.ObjectNameGenerator;
 import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.ObjEntity;


Mime
View raw message