cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject [1/2] cayenne git commit: CAY-2115 DbLoader - allow loading DataMap without Obj layer
Date Mon, 03 Oct 2016 18:15:23 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 1d81cf612 -> 756e06b33


CAY-2115 DbLoader - allow loading DataMap without Obj layer

* Removing any notion of the object layer from DbLoader


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

Branch: refs/heads/master
Commit: 83b2712754d61df725b208540545b021272cb45b
Parents: 1d81cf6
Author: Andrus Adamchik <andrus@objectstyle.com>
Authored: Mon Oct 3 18:49:03 2016 +0300
Committer: Andrus Adamchik <andrus@objectstyle.com>
Committed: Mon Oct 3 21:10:37 2016 +0300

----------------------------------------------------------------------
 .../cayenne/dbsync/reverse/db/DbLoader.java     | 48 ++++----------------
 .../dbsync/reverse/db/DbTableLoader.java        | 21 ++++-----
 .../apache/cayenne/dbsync/merge/MergeCase.java  |  2 +-
 .../cayenne/dbsync/reverse/db/DbLoaderIT.java   | 36 +--------------
 .../tools/dbimport/DbImportConfiguration.java   | 19 +-------
 .../dbimport/DefaultDbImportActionTest.java     | 16 +++----
 .../cayenne/modeler/action/MigrateAction.java   |  4 +-
 .../modeler/dialog/db/MergerOptions.java        |  3 +-
 .../modeler/dialog/db/ModelerDbLoader.java      |  3 +-
 9 files changed, 35 insertions(+), 117 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/83b27127/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/db/DbLoader.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/db/DbLoader.java
b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/db/DbLoader.java
index 546d665..7d32671 100644
--- a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/db/DbLoader.java
+++ b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/db/DbLoader.java
@@ -20,7 +20,6 @@ package org.apache.cayenne.dbsync.reverse.db;
 
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.TypesMapping;
-import org.apache.cayenne.dbsync.merge.EntityMergeSupport;
 import org.apache.cayenne.dbsync.naming.NameBuilder;
 import org.apache.cayenne.dbsync.naming.ObjectNameGenerator;
 import org.apache.cayenne.dbsync.reverse.filters.CatalogFilter;
@@ -55,8 +54,7 @@ import java.util.Set;
 import java.util.TreeSet;
 
 /**
- * Performs reverse engineering of the database. It can create
- * DataMaps using database meta data obtained via JDBC driver.
+ * Performs reverse engineering of the database, loading DB metadata in provided DataMap.
  *
  * @since 4.0
  */
@@ -69,14 +67,13 @@ public class DbLoader {
     private final Connection connection;
     private final DbAdapter adapter;
     private final DbLoaderDelegate delegate;
-
-    private EntityMergeSupport entityMergeSupport;
+    private ObjectNameGenerator nameGenerator;
     private DatabaseMetaData metaData;
 
-    public DbLoader(Connection connection, DbAdapter adapter, DbLoaderDelegate delegate,
EntityMergeSupport entityMergeSupport) {
+    public DbLoader(Connection connection, DbAdapter adapter, DbLoaderDelegate delegate,
ObjectNameGenerator nameGenerator) {
         this.adapter = Objects.requireNonNull(adapter);
         this.connection = Objects.requireNonNull(connection);
-        this.entityMergeSupport = Objects.requireNonNull(entityMergeSupport);
+        this.nameGenerator = Objects.requireNonNull(nameGenerator);
         this.delegate = delegate == null ? new DefaultDbLoaderDelegate() : delegate;
     }
 
@@ -224,20 +221,6 @@ public class DbLoader {
         }
     }
 
-    /**
-     * Creates an ObjEntity for each DbEntity in the map.
-     */
-    Collection<ObjEntity> loadObjEntities(DataMap map, DbLoaderConfiguration config,
-                                          Collection<DbEntity> entities) {
-        Collection<ObjEntity> loadedEntities = DbLoader
-                .loadObjEntities(map, config, entities, entityMergeSupport.getNameGenerator());
-
-        entityMergeSupport.synchronizeWithDbEntities(loadedEntities);
-
-        return loadedEntities;
-    }
-
-
     protected void loadDbRelationships(DbLoaderConfiguration config, String catalog, String
schema,
                                        List<DbEntity> tables) throws SQLException {
         if (config.isSkipRelationshipsLoading()) {
@@ -250,8 +233,6 @@ public class DbLoader {
             tablesMap.put(table.getName(), table);
         }
 
-        ObjectNameGenerator nameGenerator = entityMergeSupport.getNameGenerator();
-
         Map<String, Set<ExportedKey>> keys = loadExportedKeys(config, catalog,
schema, tablesMap);
         for (Map.Entry<String, Set<ExportedKey>> entry : keys.entrySet()) {
             if (LOGGER.isDebugEnabled()) {
@@ -473,28 +454,19 @@ public class DbLoader {
 
         for (CatalogFilter catalog : config.getFiltersConfig().catalogs) {
             for (SchemaFilter schema : catalog.schemas) {
-
                 List<DbEntity> entities = createTableLoader(catalog.name, schema.name,
schema.tables).loadDbEntities(
                         dataMap, config, types);
-
-                if (entities != null) {
-                    loadDbRelationships(config, catalog.name, schema.name, entities);
-
-                    prepareObjLayer(dataMap, config, entities);
-                }
+                loadDbRelationships(config, catalog.name, schema.name, entities);
             }
         }
     }
 
     protected DbTableLoader createTableLoader(String catalog, String schema, TableFilter
filter) throws SQLException {
-        return new DbTableLoader(catalog, schema, getMetaData(), delegate, new DbAttributesPerSchemaLoader(catalog,
-                schema, getMetaData(), adapter, filter));
-    }
-
-    private void prepareObjLayer(DataMap dataMap, DbLoaderConfiguration config, Collection<DbEntity>
entities) {
-        Collection<ObjEntity> loadedObjEntities = loadObjEntities(dataMap, config,
entities);
-        flattenManyToManyRelationships(dataMap, loadedObjEntities, entityMergeSupport.getNameGenerator());
-        fireObjEntitiesAddedEvents(loadedObjEntities);
+        return new DbTableLoader(catalog,
+                schema,
+                getMetaData(),
+                delegate,
+                new DbAttributesPerSchemaLoader(catalog, schema, getMetaData(), adapter,
filter));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cayenne/blob/83b27127/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/db/DbTableLoader.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/db/DbTableLoader.java
b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/db/DbTableLoader.java
index d1230bd..1bea9c0 100644
--- a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/db/DbTableLoader.java
+++ b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/db/DbTableLoader.java
@@ -18,15 +18,6 @@
  ****************************************************************/
 package org.apache.cayenne.dbsync.reverse.db;
 
-import java.sql.DatabaseMetaData;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-
 import org.apache.cayenne.dbsync.reverse.filters.PatternFilter;
 import org.apache.cayenne.dbsync.reverse.filters.TableFilter;
 import org.apache.cayenne.map.DataMap;
@@ -37,6 +28,15 @@ import org.apache.cayenne.map.ObjEntity;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import java.sql.DatabaseMetaData;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
 /**
  * @since 4.0
  */
@@ -70,7 +70,6 @@ public class DbTableLoader {
 	 *
 	 * @param types
 	 *            The types of table names to retrieve, null returns all types.
-	 * @return
 	 * @since 4.0
 	 */
 	public List<DetectedDbEntity> getDbEntities(TableFilter filters, String[] types) throws
SQLException {
@@ -130,7 +129,7 @@ public class DbTableLoader {
 
 		List<DetectedDbEntity> tables = getDbEntities(config.getFiltersConfig().tableFilter(catalog,
schema), types);
 
-		List<DbEntity> dbEntities = new ArrayList<DbEntity>();
+		List<DbEntity> dbEntities = new ArrayList<>();
 		for (DbEntity dbEntity : tables) {
 			DbEntity oldEnt = map.getDbEntity(dbEntity.getName());
 			if (oldEnt != null) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/83b27127/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 afdcb01..6c0fca2 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
@@ -112,7 +112,7 @@ public abstract class MergeCase extends DbSyncCase {
             dbImport = new DbLoader(conn,
                     node.getAdapter(),
                     new LoggingDbLoaderDelegate(LogFactory.getLog(DbLoader.class)),
-                    new EntityMergeSupport(new DefaultObjectNameGenerator(), true, true))
+                    new DefaultObjectNameGenerator())
                     .load(loaderConfiguration);
 
         } catch (SQLException e) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/83b27127/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/reverse/db/DbLoaderIT.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/reverse/db/DbLoaderIT.java
b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/reverse/db/DbLoaderIT.java
index fe46391..e9feeff 100644
--- a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/reverse/db/DbLoaderIT.java
+++ b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/reverse/db/DbLoaderIT.java
@@ -22,7 +22,6 @@ package org.apache.cayenne.dbsync.reverse.db;
 import org.apache.cayenne.configuration.server.ServerRuntime;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.TypesMapping;
-import org.apache.cayenne.dbsync.merge.EntityMergeSupport;
 import org.apache.cayenne.dbsync.naming.DefaultObjectNameGenerator;
 import org.apache.cayenne.dbsync.reverse.filters.FiltersConfig;
 import org.apache.cayenne.dbsync.reverse.filters.PatternFilter;
@@ -93,11 +92,7 @@ public class DbLoaderIT extends ServerCase {
     }
 
     private DbLoader createDbLoader(boolean meaningfulPK, boolean meaningfulFK) {
-        EntityMergeSupport emSupport = new EntityMergeSupport(new DefaultObjectNameGenerator(),
-                !meaningfulPK,
-                !meaningfulFK);
-
-        return new DbLoader(connection, adapter, null, emSupport);
+        return new DbLoader(connection, adapter, null, new DefaultObjectNameGenerator());
     }
 
     @After
@@ -161,27 +156,6 @@ public class DbLoaderIT extends ServerCase {
         assertTrue(tables.isEmpty());
     }
 
-    @Test
-    public void testLoadWithMeaningfulPK() throws Exception {
-
-        DbLoader loader = createDbLoader(true, false);
-
-        DataMap map = new DataMap();
-        String[] tableLabel = {adapter.tableTypeForTable()};
-
-        List<DbEntity> entities = loader
-                .createTableLoader(null, null, TableFilter.everything())
-                .loadDbEntities(map, CONFIG, tableLabel);
-
-        loader.loadObjEntities(map, CONFIG, entities);
-
-        ObjEntity artist = map.getObjEntity("Artist");
-        assertNotNull(artist);
-
-        ObjAttribute id = artist.getAttribute("artistId");
-        assertNotNull(id);
-    }
-
     /**
      * DataMap loading is in one big test method, since breaking it in
      * individual tests would require multiple reads of metatdata which is
@@ -244,14 +218,8 @@ public class DbLoaderIT extends ServerCase {
             }
         }
 
-        // *** TESTING THIS ***
-        loader.loadObjEntities(map, CONFIG, entities);
-
-        assertObjEntities(map);
-
         // now when the map is loaded, test
-        // various things
-        // selectively check how different types were processed
+        // various things selectively check how different types were processed
         if (accessStackAdapter.supportsColumnTypeReengineering()) {
             checkTypes(map);
         }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/83b27127/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 eae0dd1..d4e9fcb 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
@@ -23,12 +23,9 @@ import org.apache.cayenne.configuration.DataNodeDescriptor;
 import org.apache.cayenne.conn.DataSourceInfo;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dbsync.merge.DefaultModelMergeDelegate;
-import org.apache.cayenne.dbsync.merge.EntityMergeSupport;
 import org.apache.cayenne.dbsync.merge.ModelMergeDelegate;
 import org.apache.cayenne.dbsync.naming.DefaultObjectNameGenerator;
 import org.apache.cayenne.dbsync.naming.ObjectNameGenerator;
-import org.apache.cayenne.dbsync.reverse.NameFilter;
-import org.apache.cayenne.dbsync.reverse.NamePatternMatcher;
 import org.apache.cayenne.dbsync.reverse.db.DbLoader;
 import org.apache.cayenne.dbsync.reverse.db.DbLoaderConfiguration;
 import org.apache.cayenne.dbsync.reverse.db.DbLoaderDelegate;
@@ -37,7 +34,6 @@ import org.apache.cayenne.dbsync.reverse.db.LoggingDbLoaderDelegate;
 import org.apache.cayenne.dbsync.reverse.filters.CatalogFilter;
 import org.apache.cayenne.dbsync.reverse.filters.FiltersConfig;
 import org.apache.cayenne.map.DataMap;
-import org.apache.cayenne.map.DbEntity;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.resource.URLResource;
 import org.apache.commons.logging.Log;
@@ -140,20 +136,7 @@ public class DbImportConfiguration {
 
     public DbLoader createLoader(DbAdapter adapter, Connection connection, DbLoaderDelegate
loaderDelegate)
             throws InstantiationException, IllegalAccessException, ClassNotFoundException
{
-
-        final NameFilter meaningfulPkFilter = NamePatternMatcher.build(logger, getMeaningfulPkTables(),
-                getMeaningfulPkTables() != null ? null : "*");
-
-        EntityMergeSupport emSupport = new EntityMergeSupport(getNameGenerator(), true, true)
{
-
-            @Override
-            protected boolean removePK(DbEntity dbEntity) {
-                return !meaningfulPkFilter.isIncluded(dbEntity.getName());
-            }
-        };
-
-        emSupport.setUsingPrimitives(isUsePrimitives());
-        return new DbLoader(connection, adapter, loaderDelegate, emSupport);
+        return new DbLoader(connection, adapter, loaderDelegate, getNameGenerator());
     }
 
     public ObjectNameGenerator getNameGenerator() {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/83b27127/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 4f118e5..cbe8156 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
@@ -29,15 +29,15 @@ import org.apache.cayenne.dbsync.merge.AddRelationshipToDb;
 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.EntityMergeSupport;
-import org.apache.cayenne.dbsync.merge.factory.MergerTokenFactoryProvider;
 import org.apache.cayenne.dbsync.merge.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;
+import org.apache.cayenne.dbsync.naming.DefaultObjectNameGenerator;
+import org.apache.cayenne.dbsync.naming.ObjectNameGenerator;
 import org.apache.cayenne.dbsync.reverse.db.DbLoader;
 import org.apache.cayenne.dbsync.reverse.db.DbLoaderConfiguration;
 import org.apache.cayenne.dbsync.reverse.db.DbLoaderDelegate;
-import org.apache.cayenne.dbsync.naming.DefaultObjectNameGenerator;
 import org.apache.cayenne.di.DIBootstrap;
 import org.apache.cayenne.di.Injector;
 import org.apache.cayenne.map.DataMap;
@@ -99,20 +99,20 @@ public class DefaultDbImportActionTest {
     private DbAdapter mockAdapter;
     private Connection mockConnection;
     private DbLoaderDelegate mockDelegate;
-    private EntityMergeSupport mockEmSupport;
+    private ObjectNameGenerator mockNameGenerator;
 
     @Before
     public void before() {
         mockAdapter = mock(DbAdapter.class);
         mockConnection = mock(Connection.class);
         mockDelegate = mock(DbLoaderDelegate.class);
-        mockEmSupport = mock(EntityMergeSupport.class);
+        mockNameGenerator = mock(ObjectNameGenerator.class);
     }
 
     @Test
     public void testNewDataMapImport() throws Exception {
 
-        DbLoader dbLoader = new DbLoader(mockConnection, mockAdapter, mockDelegate, mockEmSupport)
{
+        DbLoader dbLoader = new DbLoader(mockConnection, mockAdapter, mockDelegate, mockNameGenerator)
{
             @Override
             public void load(DataMap dataMap, DbLoaderConfiguration config) throws SQLException
{
                 new DataMapBuilder(dataMap).withDbEntities(2).build();
@@ -146,7 +146,7 @@ public class DefaultDbImportActionTest {
 
     @Test
     public void testImportWithFieldChanged() throws Exception {
-        DbLoader dbLoader = new DbLoader(mockConnection, mockAdapter, mockDelegate, mockEmSupport)
{
+        DbLoader dbLoader = new DbLoader(mockConnection, mockAdapter, mockDelegate, mockNameGenerator)
{
             @Override
             public void load(DataMap dataMap, DbLoaderConfiguration config) throws SQLException
{
                 new DataMapBuilder(dataMap).with(
@@ -211,7 +211,7 @@ public class DefaultDbImportActionTest {
 
     @Test
     public void testImportWithoutChanges() throws Exception {
-        DbLoader dbLoader = new DbLoader(mockConnection, mockAdapter, mockDelegate, mockEmSupport)
{
+        DbLoader dbLoader = new DbLoader(mockConnection, mockAdapter, mockDelegate, mockNameGenerator)
{
             @Override
             public void load(DataMap dataMap, DbLoaderConfiguration config) throws SQLException
{
                 new DataMapBuilder(dataMap).with(

http://git-wip-us.apache.org/repos/asf/cayenne/blob/83b27127/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 a629477..9c5436a 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
@@ -20,7 +20,6 @@
 package org.apache.cayenne.modeler.action;
 
 import org.apache.cayenne.dba.DbAdapter;
-import org.apache.cayenne.dbsync.merge.EntityMergeSupport;
 import org.apache.cayenne.dbsync.merge.factory.MergerTokenFactoryProvider;
 import org.apache.cayenne.dbsync.naming.DefaultObjectNameGenerator;
 import org.apache.cayenne.dbsync.reverse.db.DbLoader;
@@ -108,7 +107,6 @@ public class MigrateAction extends DBWizardAction {
         DataSource dataSource = connectWizard.getConnectionInfo()
                 .makeDataSource(getApplication().getClassLoadingService());
 
-        EntityMergeSupport emSupport = new EntityMergeSupport(new DefaultObjectNameGenerator(),
true, true);
-        return new DbLoader(dataSource.getConnection(), dbAdapter, null, emSupport).loadSchemas();
+        return new DbLoader(dataSource.getConnection(), dbAdapter, null, new DefaultObjectNameGenerator()).loadSchemas();
     }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/83b27127/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 41a9e43..e0aeba6 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
@@ -25,7 +25,6 @@ import org.apache.cayenne.configuration.DataNodeDescriptor;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.dbsync.merge.AbstractToDbToken;
 import org.apache.cayenne.dbsync.merge.DbMerger;
-import org.apache.cayenne.dbsync.merge.EntityMergeSupport;
 import org.apache.cayenne.dbsync.merge.MergeDirection;
 import org.apache.cayenne.dbsync.merge.MergerContext;
 import org.apache.cayenne.dbsync.merge.MergerToken;
@@ -184,7 +183,7 @@ public class MergerOptions extends CayenneController {
                 dbImport =  new DbLoader(conn,
                         adapter,
                         new LoggingDbLoaderDelegate(LogFactory.getLog(DbLoader.class)),
-                        new EntityMergeSupport(new DefaultObjectNameGenerator(), true, true))
+                        new DefaultObjectNameGenerator())
                         .load(config);
 
             } catch (SQLException e) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/83b27127/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/ModelerDbLoader.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/ModelerDbLoader.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/ModelerDbLoader.java
index 4a5f53e..b4b08b5 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/ModelerDbLoader.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/ModelerDbLoader.java
@@ -18,7 +18,6 @@
  ****************************************************************/
 package org.apache.cayenne.modeler.dialog.db;
 
-import org.apache.cayenne.dbsync.merge.EntityMergeSupport;
 import org.apache.cayenne.dbsync.naming.DefaultObjectNameGenerator;
 import org.apache.cayenne.dbsync.reverse.db.DbLoader;
 import org.apache.cayenne.dbsync.reverse.db.DbLoaderConfiguration;
@@ -57,7 +56,7 @@ class ModelerDbLoader extends DbLoader {
         super(connection,
                 reverseEngineeringController.adapter,
                 new DefaultDbLoaderDelegate(),
-                new EntityMergeSupport(new DefaultObjectNameGenerator(), true, true));
+                new DefaultObjectNameGenerator());
         this.treeEditor = treeEditor;
         this.reverseEngineeringController = reverseEngineeringController;
     }


Mime
View raw message