db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1164919 - in /db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl: derby/table.vm mssql/table.vm mysql/table.vm oracle/table.vm postgresql/table.vm
Date Sat, 03 Sep 2011 19:37:21 GMT
Author: tfischer
Date: Sat Sep  3 19:37:20 2011
New Revision: 1164919

URL: http://svn.apache.org/viewvc?rev=1164919&view=rev
Log:
Fixed problem with $stringUtils.chop() on systems with unix-like eol style

Modified:
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/table.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/table.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mysql/table.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/oracle/table.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/postgresql/table.vm

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/table.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/table.vm?rev=1164919&r1=1164918&r2=1164919&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/table.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/table.vm
Sat Sep  3 19:37:20 2011
@@ -23,9 +23,9 @@ CREATE TABLE $name
 #set ( $cols = $torqueGen.mergepoint("columns") )
 #set ( $pk = $torqueGen.mergepoint("primaryKey") )
 #set ( $unique = $torqueGen.mergepoint("unique") )
-#if($stringUtils.allEmpty([$pk,$unique,$index]))$stringUtils.chop($cols,2)#else$cols#end
-#if($stringUtils.allEmpty([$unique,$index]) && $pk.length()>0)$stringUtils.chop($pk,2)#else$pk#end
-#if($unique.length()>0)$stringUtils.chop($unique,2)#else$unique#end
+#set ( $createTableSql = "${cols}${pk}${unique}")
+#set ( $lastCommaPos = $createTableSql.lastIndexOf(","))
+#if ($lastCommaPos == -1)${createTableSql}#else${createTableSql.substring(0, $lastCommaPos)}#end
 )##
 $torqueGen.mergepoint("createOptions")##
 ;

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/table.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/table.vm?rev=1164919&r1=1164918&r2=1164919&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/table.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/table.vm
Sat Sep  3 19:37:20 2011
@@ -23,10 +23,9 @@ CREATE TABLE $name
 #set ( $cols = $torqueGen.mergepoint("columns") )
 #set ( $pk = $torqueGen.mergepoint("primaryKey") )
 #set ( $unique = $torqueGen.mergepoint("unique") )
-#if($stringUtils.allEmpty([$pk,$unique]))$stringUtils.chop($cols,2)#else$cols#end
-#if($stringUtils.allEmpty([$unique]) && $pk.length()>0)$stringUtils.chop($pk,2)#else$pk#end
-#if($unique.length() > 0)$stringUtils.chop($unique,2)#end
-
+#set ( $createTableSql = "${cols}${pk}${unique}")
+#set ( $lastCommaPos = $createTableSql.lastIndexOf(","))
+#if ($lastCommaPos == -1)${createTableSql}#else${createTableSql.substring(0, $lastCommaPos)}#end
 )##
 $torqueGen.mergepoint("createOptions")##
 ;

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mysql/table.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mysql/table.vm?rev=1164919&r1=1164918&r2=1164919&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mysql/table.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mysql/table.vm
Sat Sep  3 19:37:20 2011
@@ -24,10 +24,9 @@ CREATE TABLE $name
 #set ( $pk = $torqueGen.mergepoint("primaryKey") )
 #set ( $unique = $torqueGen.mergepoint("unique") )
 #set ( $index = $torqueGen.mergepoint("index") )
-#if($stringUtils.allEmpty([$pk,$unique,$index]))$stringUtils.chop($cols,2)#else$cols#end
-#if($stringUtils.allEmpty([$unique,$index]) && $pk.length()>0)$stringUtils.chop($pk,2)#else$pk#end
-#if($stringUtils.allEmpty([$index]) && $unique.length()>0)$stringUtils.chop($unique,2)#else$unique#end
-#if($index.length()>0)$stringUtils.chop($index,2)#end
+#set ( $createTableSql = "${cols}${pk}${unique}${index}")
+#set ( $lastCommaPos = $createTableSql.lastIndexOf(","))
+#if ($lastCommaPos == -1)${createTableSql}#else${createTableSql.substring(0, $lastCommaPos)}#end
 
 )##
 $torqueGen.mergepoint("createOptions")##

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/oracle/table.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/oracle/table.vm?rev=1164919&r1=1164918&r2=1164919&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/oracle/table.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/oracle/table.vm
Sat Sep  3 19:37:20 2011
@@ -22,8 +22,9 @@ CREATE TABLE $name
 (
 #set ( $cols = $torqueGen.mergepoint("columns") )
 #set ( $unique = $torqueGen.mergepoint("unique") )
-#if($stringUtils.allEmpty([$unique]))$stringUtils.chop($cols,2)#else$cols#end
-#if($unique.length()>0)$stringUtils.chop($unique,2)#end
+#set ( $createTableSql = "${cols}${unique}")
+#set ( $lastCommaPos = $createTableSql.lastIndexOf(","))
+#if ($lastCommaPos == -1)${createTableSql}#else${createTableSql.substring(0, $lastCommaPos)}#end
 
 )##
 $torqueGen.mergepoint("createOptions")##

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/postgresql/table.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/postgresql/table.vm?rev=1164919&r1=1164918&r2=1164919&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/postgresql/table.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/postgresql/table.vm
Sat Sep  3 19:37:20 2011
@@ -23,10 +23,9 @@ CREATE TABLE $name
 #set ( $cols = $torqueGen.mergepoint("columns") )
 #set ( $pk = $torqueGen.mergepoint("primaryKey") )
 #set ( $unique = $torqueGen.mergepoint("unique") )
-#if($stringUtils.allEmpty([$pk,$unique]))$stringUtils.chop($cols,2)#else$cols#end
-#if($stringUtils.allEmpty([$unique]) && $pk.length()>0)$stringUtils.chop($pk,2)#else$pk#end
-#if($unique.length() > 0)$stringUtils.chop($unique,2)#end
-
+#set ( $createTableSql = "${cols}${pk}${unique}")
+#set ( $lastCommaPos = $createTableSql.lastIndexOf(","))
+#if ($lastCommaPos == -1)${createTableSql}#else${createTableSql.substring(0, $lastCommaPos)}#end
 )##
 $torqueGen.mergepoint("createOptions")##
 ;



---------------------------------------------------------------------
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