mpoeschl    2003/08/08 02:49:11

  Modified:    src/generator/src/templates/om Object.vm
                        ObjectWithManager.vm
               xdocs    changes.xml
  Log:
  TRQS87: name conflict in generated java sources when using java reserved words (like 
"class") as column names.
  
  Revision  Changes    Path
  1.6       +8 -8      db-torque/src/generator/src/templates/om/Object.vm
  
  Index: Object.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/om/Object.vm,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Object.vm 7 Aug 2003 13:13:00 -0000       1.5
  +++ Object.vm 8 Aug 2003 09:49:11 -0000       1.6
  @@ -69,7 +69,7 @@
   #if (!$table.isAlias())
     #foreach ($col in $table.Columns)
       #set ( $cjtype = $col.JavaNative )
  -    #set ( $clo=$col.Name.toLowerCase() )
  +    #set ( $clo=$col.UncapitalisedJavaName )
       #set ($defVal = "")
       #if ($col.DefaultValue && !$col.DefaultValue.equalsIgnoreCase("NULL") )
         #set ( $quote = '' )
  @@ -108,7 +108,7 @@
   
     #foreach ($col in $table.Columns)
       #set ( $cfc=$col.JavaName )
  -    #set ( $clo=$col.Name.toLowerCase() )
  +    #set ( $clo=$col.UncapitalisedJavaName )
       #set ( $cjtype = $col.JavaNative )
   
           /**
  @@ -291,7 +291,7 @@
           #foreach ($columnName in $fk.LocalColumns)
             #set ( $column = $table.getColumn($columnName) )
             #set ( $cjtype = $column.JavaNative )
  -          #set ( $clo=$column.Name.toLowerCase() )
  +          #set ( $clo=$column.UncapitalisedJavaName )
             #if ($cjtype == "short" || $cjtype == "int" || $cjtype == "long" || 
$cjtype == "byte" || $cjtype == "float" || $cjtype == "double")
               #set ( $conditional = "$conditional${and}this.${clo} > 0" )
             #else
  @@ -1165,7 +1165,7 @@
           #set ( $throwsClause = "throws TorqueException" )
         #end
       #end
  -    #set ( $clo=$col.Name.toLowerCase() )
  +    #set ( $clo=$col.UncapitalisedJavaName )
       #set ( $cjtype = $col.JavaNative )
       #set ($argList = "${argList}$comma $cjtype $clo")
       #set ($argList2 = "${argList2}$comma String $clo")
  @@ -1174,7 +1174,7 @@
   
     #if ($table.PrimaryKey.size() == 1)
       #set ($col = $table.PrimaryKey.get(0) )
  -    #set ( $clo=$col.Name.toLowerCase() )
  +    #set ( $clo=$col.UncapitalisedJavaName )
       #set ( $cjtype= $col.JavaNative )
       /**
        * Set the PrimaryKey using ObjectKey.
  @@ -1316,7 +1316,7 @@
        * Set the PrimaryKey using SimpleKeys.
        *
       #foreach ($col in $table.PrimaryKey)
  -      #set ( $clo=$col.Name.toLowerCase() )
  +      #set ( $clo=$col.UncapitalisedJavaName )
         #set ( $cjtype= $col.JavaNative )
        * @param $cjtype $clo
       #end
  @@ -1325,7 +1325,7 @@
           $throwsClause
       {
       #foreach ($col in $table.PrimaryKey)
  -         set${col.JavaName}($col.Name.toLowerCase());
  +         set${col.JavaName}($col.UncapitalisedJavaName);
       #end
       }
   
  @@ -1410,7 +1410,7 @@
       protected $table.JavaName copyInto($table.JavaName copyObj) throws 
TorqueException
       {
     #foreach ($col in $table.Columns)
  -        copyObj.set${col.JavaName}($col.Name.toLowerCase());
  +        copyObj.set${col.JavaName}($col.UncapitalisedJavaName);
     #end
   
     #foreach ($col in $table.Columns)
  
  
  
  1.4       +8 -8      db-torque/src/generator/src/templates/om/ObjectWithManager.vm
  
  Index: ObjectWithManager.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/om/ObjectWithManager.vm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ObjectWithManager.vm      7 Aug 2003 13:13:00 -0000       1.3
  +++ ObjectWithManager.vm      8 Aug 2003 09:49:11 -0000       1.4
  @@ -70,7 +70,7 @@
   #if (!$table.isAlias())
     #foreach ($col in $table.Columns)
       #set ( $cjtype = $col.JavaNative )
  -    #set ( $clo=$col.Name.toLowerCase() )
  +    #set ( $clo=$col.UncapitalisedJavaName )
       #set ($defVal = "")
       #if ($col.DefaultValue && !$col.DefaultValue.equalsIgnoreCase("NULL") )
         #set ( $quote = '' )
  @@ -109,7 +109,7 @@
   
     #foreach ($col in $table.Columns)
       #set ( $cfc=$col.JavaName )
  -    #set ( $clo=$col.Name.toLowerCase() )
  +    #set ( $clo=$col.UncapitalisedJavaName )
       #set ( $cjtype = $col.JavaNative )
   
           /**
  @@ -291,7 +291,7 @@
       #foreach ($columnName in $fk.LocalColumns)
         #set ( $column = $table.getColumn($columnName) )
         #set ( $cjtype = $column.JavaNative )
  -      #set ( $clo=$column.Name.toLowerCase() )
  +      #set ( $clo=$column.UncapitalisedJavaName )
         #if ($cjtype == "short" || $cjtype == "int" || $cjtype == "long" || $cjtype 
== "byte" || $cjtype == "float" || $cjtype == "double")
           #set ( $conditional = "$conditional${and}get${column.JavaName}()>0" )
         #else
  @@ -1139,7 +1139,7 @@
           #set ( $throwsClause = "throws TorqueException" )
         #end
       #end
  -    #set ( $clo=$col.Name.toLowerCase() )
  +    #set ( $clo=$col.UncapitalisedJavaName )
       #set ( $cjtype = $col.JavaNative )
       #set ($argList = "${argList}$comma $cjtype $clo")
       #set ($argList2 = "${argList2}$comma String $clo")
  @@ -1148,7 +1148,7 @@
   
     #if ($table.PrimaryKey.size() == 1)
       #set ($col = $table.PrimaryKey.get(0) )
  -    #set ( $clo=$col.Name.toLowerCase() )
  +    #set ( $clo=$col.UncapitalisedJavaName )
       #set ( $cjtype= $col.JavaNative )
       /**
        * Set the PrimaryKey using ObjectKey.
  @@ -1285,7 +1285,7 @@
        * Set the PrimaryKey using SimpleKeys.
        *
       #foreach ($col in $table.PrimaryKey)
  -      #set ( $clo=$col.Name.toLowerCase() )
  +      #set ( $clo=$col.UncapitalisedJavaName )
         #set ( $cjtype= $col.JavaNative )
        * @param $cjtype $clo
       #end
  @@ -1293,7 +1293,7 @@
       public void setPrimaryKey($argList)
           $throwsClause {
       #foreach ($col in $table.PrimaryKey)
  -         set${col.JavaName}($col.Name.toLowerCase());
  +         set${col.JavaName}($col.UncapitalisedJavaName);
       #end
       }
   
  @@ -1372,7 +1372,7 @@
           $table.JavaName copyObj = new ${table.JavaName}();
     #end
     #foreach ($col in $table.Columns)
  -        copyObj.set${col.JavaName}($col.Name.toLowerCase());
  +        copyObj.set${col.JavaName}($col.UncapitalisedJavaName);
     #end
   
     #foreach ($col in $table.Columns)
  
  
  
  1.101     +6 -0      db-torque/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/db-torque/xdocs/changes.xml,v
  retrieving revision 1.100
  retrieving revision 1.101
  diff -u -r1.100 -r1.101
  --- changes.xml       7 Aug 2003 21:27:46 -0000       1.100
  +++ changes.xml       8 Aug 2003 09:49:11 -0000       1.101
  @@ -40,6 +40,12 @@
         TRQS85: Torque.initialize not reentrant
       </li>
       <li>
  +      TRQS87: name conflict in generated java sources when using java reserved 
  +      words (like "class") as column names. <br/>
  +      <code>Column.UncapitalisedJavaName</code> is now used as member name 
  +      instead of <code>Column.Name.toLowerCase()</code> <br/>
  +    </li>
  +    <li>
         TRQS136: MySQL will not accept a size definition for TEXT and BLOB fields
       </li>
       <li>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to