tfischer    2005/02/16 01:24:11

  Modified:    src/generator/src/templates/om ObjectWithManager.vm
  Log:
  Fixed a problem that the Cache Manager misses saves. In Thomas Vandahl's 
words:
  In ObjectWithManager.vm there is a problem in the line
  
  #set ($tableHasPrimaryKey = $table.PrimaryKey.size() > 0)
  
  Velocity barfs on this statement ("rhs of #set statement is null")
  
  The generated save(Connection con) method misses the cache update call in 
this case.
  The bug was introduced fairly recently in Rev 1.15 in an attempt to fix the 
generated code for tables without PKs. Torque 3.1.1 works fine.
  
  PR: TRQS279
  Submitted by: Thomas Vandahl
  
  Revision  Changes    Path
  1.17      +6 -1      
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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ObjectWithManager.vm      31 Jan 2005 19:43:57 -0000      1.16
  +++ ObjectWithManager.vm      16 Feb 2005 09:24:11 -0000      1.17
  @@ -1107,7 +1107,12 @@
                       ${table.JavaName}Peer.doUpdate(($table.JavaName) this, 
con);
                   }
   
  -  #set ($tableHasPrimaryKey = $table.PrimaryKey.size() > 0)
  +  #if ($table.PrimaryKey.size() > 0)
  +    #set ($tableHasPrimaryKey = true)
  +  #else
  +    #set ($tableHasPrimaryKey = false)
  +  #end
  +
     #if ($tableHasPrimaryKey)
       #set ($interfaceName = $table.JavaName)
       #if ($table.Interface)
  
  
  

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

Reply via email to