db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henn...@apache.org
Subject cvs commit: db-torque/src/generator/src/templates/om Peer.vm
Date Tue, 26 Oct 2004 12:48:31 GMT
henning     2004/10/26 05:48:31

  Modified:    src/generator/src/templates/om Tag: TORQUE_3_1_BRANCH
                        Peer.vm
  Log:
  And here it is, the very, very, very last second bug fix.
  
  The fix for TRQS230 broke binary columns for insert and update. The
  bug as actually caught by a Turbine Unit test and pointed out by Scott
  but I didn't recognize it as a Torque bug until I started rolling
  release versions.
  
  This bug fix warrants IMHO to move the TORQUE_3_1_1 tag (just a little...)
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.5.2.12  +19 -3     db-torque/src/generator/src/templates/om/Peer.vm
  
  Index: Peer.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/om/Peer.vm,v
  retrieving revision 1.5.2.11
  retrieving revision 1.5.2.12
  diff -u -r1.5.2.11 -r1.5.2.12
  --- Peer.vm	20 Oct 2004 21:54:30 -0000	1.5.2.11
  +++ Peer.vm	26 Oct 2004 12:48:30 -0000	1.5.2.12
  @@ -744,7 +744,7 @@
        */
       public static List doSelect($table.JavaName obj) throws TorqueException
       {
  -        return doSelect(buildCriteria(obj));
  +        return doSelect(buildSelectCriteria(obj));
       }
   
       /**
  @@ -782,7 +782,7 @@
        */
       public static void doDelete($table.JavaName obj) throws TorqueException
       {
  -        doDelete(buildCriteria(obj));
  +        doDelete(buildSelectCriteria(obj));
       }
   
       /**
  @@ -837,7 +837,7 @@
       public static void doDelete($table.JavaName obj, Connection con)
           throws TorqueException
       {
  -        doDelete(buildCriteria(obj), con);
  +        doDelete(buildSelectCriteria(obj), con);
       }
   
       /**
  @@ -889,6 +889,22 @@
   
       /** Build a Criteria object from the data object for this peer */
       public static Criteria buildCriteria( $table.JavaName obj )
  +    {
  +        Criteria criteria = new Criteria(DATABASE_NAME);
  +  #foreach ($col in $table.Columns)
  +    #set ( $cfc=$col.JavaName )
  +    #set ( $cup=$col.Name.toUpperCase() )
  +    #set ( $cjtype = $col.JavaNative )
  +    #if ($col.isPrimaryKey() && !$table.IdMethod.equals("none"))
  +        if (!obj.isNew())
  +    #end
  +        criteria.add($cup, obj.get${cfc}());
  +  #end
  +        return criteria;
  +    }
  +
  +    /** Build a Criteria object from the data object for this peer, skipping all binary
columns */
  +    public static Criteria buildSelectCriteria( $table.JavaName obj )
       {
           Criteria criteria = new Criteria(DATABASE_NAME);
     #foreach ($col in $table.Columns)
  
  
  

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