You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by nt...@apache.org on 2017/03/21 12:27:40 UTC

cayenne git commit: Catch old tag in cdbimport configuration and warn about it.

Repository: cayenne
Updated Branches:
  refs/heads/master e098f2360 -> 8c4f1ad0f


Catch old <reverseEngineering> tag in cdbimport configuration and warn about it.


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

Branch: refs/heads/master
Commit: 8c4f1ad0f5b2dea0bc02947aa197da6e2592f5d8
Parents: e098f23
Author: Nikita Timofeev <st...@gmail.com>
Authored: Tue Mar 21 15:27:30 2017 +0300
Committer: Nikita Timofeev <st...@gmail.com>
Committed: Tue Mar 21 15:27:30 2017 +0300

----------------------------------------------------------------------
 .../apache/cayenne/tools/DbImporterMojo.java    | 13 ++-
 .../cayenne/tools/OldReverseEngineering.java    | 93 ++++++++++++++++++++
 2 files changed, 102 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/8c4f1ad0/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java b/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
index e64de29..ae9aa90 100644
--- a/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
+++ b/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
@@ -100,6 +100,11 @@ public class DbImporterMojo extends AbstractMojo {
     @Deprecated @Parameter(name = "defaultPackage", property = "defaultPackage")
     private final String oldDefaultPackage = "";     // TODO remove in 4.0.BETA
 
+    /**
+     * @deprecated renamed to {@code <dbimport>},  remove in 4.0.BETA
+     */
+    @Deprecated @Parameter
+    public OldReverseEngineering reverseEngineering;
 
     public void execute() throws MojoExecutionException, MojoFailureException {
 
@@ -194,25 +199,25 @@ public class DbImporterMojo extends AbstractMojo {
     // TODO \u2b07\u2b07\u2b07 All following setters should be removed in 4.0.BETA \u2b07\u2b07\u2b07
     @Deprecated
     public void setUrl(String url) {
-        throw new UnsupportedOperationException("Connection properties were replaced with <dataSource> tag since 4.0.M5.\n" +
+        throw new UnsupportedOperationException("\nConnection properties were replaced with <dataSource> tag since 4.0.M5.\n" +
                 "\tFor additional information see http://cayenne.apache.org/docs/4.0/cayenne-guide/including-cayenne-in-project.html#maven-projects");
     }
 
     @Deprecated
     public void setDriver(String driver) {
-        throw new UnsupportedOperationException("Connection properties were replaced with <dataSource> tag since 4.0.M5.\n" +
+        throw new UnsupportedOperationException("\nConnection properties were replaced with <dataSource> tag since 4.0.M5.\n" +
                 "\tFor additional information see http://cayenne.apache.org/docs/4.0/cayenne-guide/including-cayenne-in-project.html#maven-projects");
     }
 
     @Deprecated
     public void setMeaningfulPkTables(String meaningfulPkTables) {
-        throw new UnsupportedOperationException("meaningfulPkTables property has been moved to <dbimport> tag since 4.0.M5.\n" +
+        throw new UnsupportedOperationException("\nmeaningfulPkTables property has been moved to <dbimport> tag since 4.0.M5.\n" +
                 "\tFor additional information see http://cayenne.apache.org/docs/4.0/cayenne-guide/including-cayenne-in-project.html#maven-projects");
     }
 
     @Deprecated
     public void setDefaultPackage(String defaultPackage) {
-        throw new UnsupportedOperationException("defaultPackage property has been moved to <dbimport> tag since 4.0.M5.\n" +
+        throw new UnsupportedOperationException("\ndefaultPackage property has been moved to <dbimport> tag since 4.0.M5.\n" +
                 "\tFor additional information see http://cayenne.apache.org/docs/4.0/cayenne-guide/including-cayenne-in-project.html#maven-projects");
     }
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/8c4f1ad0/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/OldReverseEngineering.java
----------------------------------------------------------------------
diff --git a/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/OldReverseEngineering.java b/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/OldReverseEngineering.java
new file mode 100644
index 0000000..b2fd7e6
--- /dev/null
+++ b/maven-plugins/cayenne-maven-plugin/src/main/java/org/apache/cayenne/tools/OldReverseEngineering.java
@@ -0,0 +1,93 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+
+package org.apache.cayenne.tools;
+
+import java.util.Collection;
+import java.util.LinkedList;
+
+import org.apache.cayenne.dbsync.reverse.dbimport.Catalog;
+import org.apache.cayenne.dbsync.reverse.dbimport.ExcludeColumn;
+import org.apache.cayenne.dbsync.reverse.dbimport.ExcludeProcedure;
+import org.apache.cayenne.dbsync.reverse.dbimport.ExcludeTable;
+import org.apache.cayenne.dbsync.reverse.dbimport.IncludeColumn;
+import org.apache.cayenne.dbsync.reverse.dbimport.IncludeProcedure;
+import org.apache.cayenne.dbsync.reverse.dbimport.IncludeTable;
+import org.apache.cayenne.dbsync.reverse.dbimport.Schema;
+
+/**
+ * @since 4.0
+ * @deprecated this class exists only to catch old configuration and warn about it.
+ *             Can be deleted with deprecated members of {@link DbImporterMojo}.
+ */
+@Deprecated
+public class OldReverseEngineering {
+    private String name;
+    private Boolean skipRelationshipsLoading;
+    private Boolean skipPrimaryKeyLoading;
+    private String meaningfulPkTables;
+    private String stripFromTableNames;
+    private boolean usePrimitives;
+
+    private final Collection<Schema> schemaCollection = new LinkedList<>();
+    private final Collection<String> tableTypes = new LinkedList<>();
+    private final Collection<Catalog> catalogCollection = new LinkedList<>();
+    private final Collection<IncludeTable> includeTableCollection = new LinkedList<>();
+    private final Collection<ExcludeTable> excludeTableCollection = new LinkedList<>();
+    private final Collection<IncludeColumn> includeColumnCollection = new LinkedList<>();
+    private final Collection<ExcludeColumn> excludeColumnCollection = new LinkedList<>();
+    private final Collection<IncludeProcedure> includeProcedureCollection = new LinkedList<>();
+    private final Collection<ExcludeProcedure> excludeProcedureCollection = new LinkedList<>();
+
+    private void throwException() {
+        throw new UnsupportedOperationException("\n<reverseEngineering> tag has been renamed to <dbimport> since 4.0.M5.\n" +
+                "\tFor additional information see http://cayenne.apache.org/docs/4.0/cayenne-guide/including-cayenne-in-project.html#maven-projects");
+    }
+
+    public void setName(String name) {
+        throwException();
+    }
+    public void addTableType(String type) {
+        throwException();
+    }
+    public void addCatalog(Catalog catalog) {
+        throwException();
+    }
+    public void addSchema(Schema schema) {
+        throwException();
+    }
+    public void addIncludeColumn(IncludeColumn includeColumn) {
+        throwException();
+    }
+    public void addExcludeColumn(ExcludeColumn excludeColumn) {
+        throwException();
+    }
+    public void addIncludeTable(IncludeTable includeTable) {
+        throwException();
+    }
+    public void addExcludeTable(ExcludeTable excludeTable) {
+        throwException();
+    }
+    public void addIncludeProcedure(IncludeProcedure includeProcedure) {
+        throwException();
+    }
+    public void addExcludeProcedure(ExcludeProcedure excludeProcedure) {
+        throwException();
+    }
+}