db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r591765 - in /db/torque: maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/SqlExecMojo.java site/trunk/xdocs/changes.xml
Date Sun, 04 Nov 2007 11:24:17 GMT
Author: tfischer
Date: Sun Nov  4 03:24:16 2007
New Revision: 591765

URL: http://svn.apache.org/viewvc?rev=591765&view=rev
Log:
Added the attribute delimiterType for the sqlExec goal.

Modified:
    db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/SqlExecMojo.java
    db/torque/site/trunk/xdocs/changes.xml

Modified: db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/SqlExecMojo.java
URL: http://svn.apache.org/viewvc/db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/SqlExecMojo.java?rev=591765&r1=591764&r2=591765&view=diff
==============================================================================
--- db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/SqlExecMojo.java (original)
+++ db/torque/maven2-plugin/trunk/src/main/java/org/apache/torque/mojo/SqlExecMojo.java Sun
Nov  4 03:24:16 2007
@@ -36,7 +36,7 @@
  */
 public class SqlExecMojo
     extends AbstractMojo
-{
+{    
     /**
      * The ant task this mojo is wrapping.
      */
@@ -102,6 +102,14 @@
     private String delimiter = ";";
 
     /**
+     * Whether the delimiter can be anywhere in the sql ("normal") 
+     * or needs to be in an extra row ("row").
+     *
+     * @parameter expression="normal"
+     */
+    private String delimiterType = "normal";
+
+    /**
      * The path to the properties file containing the mapping
      * sql file -> target database.
      *
@@ -166,6 +174,30 @@
     }
 
     /**
+     * Returns whether the delimiter can be anywhere in the sql ("normal") 
+     * or needs to be in an extra row ("row").
+     *
+     * @return the delimiter type.
+     */
+    public String getDelimiterType()
+    {
+        return delimiterType;
+    }
+
+    /**
+     * Sets whether the delimiter can be anywhere in the sql ("normal") 
+     * or needs to be in an extra row ("row").
+     *
+     * @param delimiterType the delimiter type, should either be "normal"
+     *         or "row".
+     */
+    public void setDelimiterType(String delimiterType)
+    {
+        this.delimiterType = delimiterType;
+    }
+
+    
+    /**
      * Returns the fully qualified class name of the database driver.
      *
      * @return the fully qualified class name of the database driver.
@@ -329,6 +361,8 @@
     {
         antTask.setDelimiter(getDelimiter());
         getLog().debug("Delimiter = " + getDelimiter());
+        antTask.setDelimiterType(getDelimiterTypeForAnt());
+        getLog().debug("DelimiterType = " + getDelimiterType());
         antTask.setAutocommit(isAutocommit());
         getLog().debug("Autocommit = " + isAutocommit());
         antTask.setDriver(getDriver());
@@ -358,4 +392,19 @@
         onErrorAction.setValue(onError);
         return onErrorAction;
     }
+
+    /**
+     * Returns the delimiter type in a form acceptable by the ant task.
+     *
+     * @return the delimiter type setting as a DelimiterType object, 
+     *           never null.
+     */
+    private TorqueSQLExec.DelimiterType getDelimiterTypeForAnt()
+    {
+        TorqueSQLExec.DelimiterType delimiterType 
+                = new TorqueSQLExec.DelimiterType();
+        delimiterType.setValue(this.delimiterType);
+        return delimiterType;
+    }
+
 }

Modified: db/torque/site/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/db/torque/site/trunk/xdocs/changes.xml?rev=591765&r1=591764&r2=591765&view=diff
==============================================================================
--- db/torque/site/trunk/xdocs/changes.xml (original)
+++ db/torque/site/trunk/xdocs/changes.xml Sun Nov  4 03:24:16 2007
@@ -31,6 +31,9 @@
 
   <body>
   <release version="3.3-RC3" date="in SVN">
+    <action type="add" dev="tfischer">
+      Maven 2 plugin: Added the attribute delimiterType for the sqlExec goal.
+    </action>
     <action type="change" dev="tfischer">
       Maven 2 plugin: changed the default value of the parameter
       &quot;suffix&quot; in the id-table-init-sql goal



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message