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: cleanup
Date Mon, 03 Oct 2016 17:56:11 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master a811b44e5 -> 1d81cf612


cleanup


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

Branch: refs/heads/master
Commit: 616ec62ba45fbb956518d20d9043362c012e435a
Parents: a811b44
Author: Andrus Adamchik <andrus@objectstyle.com>
Authored: Mon Oct 3 20:14:22 2016 +0300
Committer: Andrus Adamchik <andrus@objectstyle.com>
Committed: Mon Oct 3 20:14:22 2016 +0300

----------------------------------------------------------------------
 .../tools/dbimport/DefaultDbImportAction.java        | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/616ec62b/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 9118d34..ab20b4e 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
@@ -124,7 +124,7 @@ public class DefaultDbImportAction implements DbImportAction {
         DbAdapter adapter = adapterFactory.createAdapter(dataNodeDescriptor, dataSource);
 
         DataMap loadedFomDb;
-        try(Connection connection = dataSource.getConnection()) {
+        try (Connection connection = dataSource.getConnection()) {
             loadedFomDb = load(config, adapter, connection);
         }
 
@@ -172,7 +172,7 @@ public class DefaultDbImportAction implements DbImportAction {
                 }
             };
 
-            DataMap executed = execute(delegate,
+            DataMap executed = applyTokens(delegate,
                     existing,
                     log(sort(reverse(mergerTokenFactory, mergeTokens))),
                     config.getNameGenerator());
@@ -224,9 +224,9 @@ public class DefaultDbImportAction implements DbImportAction {
         return null;
     }
 
-    private List<MergerToken> reverse(
-            MergerTokenFactory mergerTokenFactory,
-            Iterable<MergerToken> mergeTokens) throws IOException {
+    private List<MergerToken> reverse(MergerTokenFactory mergerTokenFactory, Iterable<MergerToken>
mergeTokens)
+            throws IOException {
+
         List<MergerToken> tokens = new LinkedList<>();
         for (MergerToken token : mergeTokens) {
             if (token instanceof AbstractToModelToken) {
@@ -237,10 +237,7 @@ public class DefaultDbImportAction implements DbImportAction {
         return tokens;
     }
 
-    /**
-     * Performs configured schema operations via DbGenerator.
-     */
-    private DataMap execute(ModelMergeDelegate mergeDelegate,
+    private DataMap applyTokens(ModelMergeDelegate mergeDelegate,
                             DataMap dataMap,
                             Collection<MergerToken> tokens,
                             ObjectNameGenerator nameGenerator) {


Mime
View raw message