cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1408005 - in /cayenne/main/trunk/framework: cayenne-tools/src/main/java/org/apache/cayenne/tools/DbImporterTask.java maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
Date Sun, 11 Nov 2012 14:31:30 GMT
Author: aadamchik
Date: Sun Nov 11 14:31:29 2012
New Revision: 1408005

URL: http://svn.apache.org/viewvc?rev=1408005&view=rev
Log:
CAY-1771 cdbimport improvements: usePrimitives flag

switching ant and maven

Modified:
    cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/tools/DbImporterTask.java
    cayenne/main/trunk/framework/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java

Modified: cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/tools/DbImporterTask.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/tools/DbImporterTask.java?rev=1408005&r1=1408004&r2=1408005&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/tools/DbImporterTask.java
(original)
+++ cayenne/main/trunk/framework/cayenne-tools/src/main/java/org/apache/cayenne/tools/DbImporterTask.java
Sun Nov 11 14:31:29 2012
@@ -23,6 +23,7 @@ import java.io.File;
 
 import org.apache.cayenne.di.DIBootstrap;
 import org.apache.cayenne.di.Injector;
+import org.apache.cayenne.map.naming.SmartNamingStrategy;
 import org.apache.cayenne.tools.configuration.ToolsModule;
 import org.apache.cayenne.tools.dbimport.DbImportAction;
 import org.apache.cayenne.tools.dbimport.DbImportModule;
@@ -51,7 +52,8 @@ public class DbImporterTask extends Task
         parameters = new DbImportParameters();
         parameters.setOverwrite(true);
         parameters.setImportProcedures(false);
-        parameters.setNamingStrategy("org.apache.cayenne.map.naming.SmartNamingStrategy");
+        parameters.setUsePrimitives(true);
+        parameters.setNamingStrategy(SmartNamingStrategy.class.getName());
     }
 
     @Override
@@ -201,6 +203,13 @@ public class DbImporterTask extends Task
         parameters.setExcludeTables(excludeTables);
     }
 
+    /**
+     * @since 3.2
+     */
+    public void setUsePrimitives(boolean usePrimitives) {
+        parameters.setUsePrimitives(usePrimitives);
+    }
+
     private void initSchema() {
         if (schemaName != null) {
             log("'schemaName' property is deprecated. Use 'schema' instead", Project.MSG_WARN);

Modified: cayenne/main/trunk/framework/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java?rev=1408005&r1=1408004&r2=1408005&view=diff
==============================================================================
--- cayenne/main/trunk/framework/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
(original)
+++ cayenne/main/trunk/framework/maven-cayenne-plugin/src/main/java/org/apache/cayenne/tools/DbImporterMojo.java
Sun Nov 11 14:31:29 2012
@@ -208,6 +208,13 @@ public class DbImporterMojo extends Abst
      */
     private String password;
 
+    /**
+     * If true, would use primitives instead of numeric and boolean classes.
+     * 
+     * @parameter expression="${cdbimport.usePrimitives}" default-value="true"
+     */
+    private boolean usePrimitives;
+
     public void execute() throws MojoExecutionException, MojoFailureException {
 
         Log logger = new MavenLogger(this);
@@ -250,6 +257,7 @@ public class DbImporterMojo extends Abst
         parameters.setUsername(username);
         parameters.setIncludeTables(includeTables);
         parameters.setExcludeTables(excludeTables);
+        parameters.setUsePrimitives(usePrimitives);
         return parameters;
     }
 



Mime
View raw message