You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by mp...@apache.org on 2002/12/11 20:03:41 UTC

cvs commit: jakarta-turbine-torque/src/templates/om Control.vm Object.vm ObjectWithManager.vm Peer.vm

mpoeschl    2002/12/11 11:03:41

  Modified:    src/templates/om Control.vm Object.vm ObjectWithManager.vm
                        Peer.vm
  Log:
  don't use deprecated methods
  
  Revision  Changes    Path
  1.10      +7 -7      jakarta-turbine-torque/src/templates/om/Control.vm
  
  Index: Control.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-torque/src/templates/om/Control.vm,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Control.vm	25 Jul 2002 03:51:13 -0000	1.9
  +++ Control.vm	11 Dec 2002 19:03:41 -0000	1.10
  @@ -5,10 +5,10 @@
   #end
   #foreach ($dataModel in $dataModels)
   #foreach ($database in $dataModel.Databases)
  -  
  +
     #if ($database.Package)
  -    #set ($package = $database.Package)   
  -  #else   
  +    #set ($package = $database.Package)
  +  #else
       #set ($package = $targetPackage)
     #end
   
  @@ -30,7 +30,7 @@
     $files.mkdir("$outputDirectory/$path")
   
     #foreach ($tbl in $database.Tables)
  -   #if (!$tbl.isForReferenceOnly())    
  +   #if (!$tbl.isForReferenceOnly())
       $tbl.Name
       #set ( $firstcap=$tbl.JavaName )
   
  @@ -44,7 +44,7 @@
         $generator.parse("om/MapBuilder.vm",$path,"table",$tbl)
       #end
   
  -#if ($useManagers && $tbl.PrimaryKeys.size() > 0)
  +#if ($useManagers && $tbl.PrimaryKey.size() > 0)
   
       #set ($interfaceName = $table.JavaName)
       #if ($table.Interface)
  @@ -56,7 +56,7 @@
       $generator.parse("om/BaseManager.vm",$path,"table",$tbl)
   
       #set ( $fname = "${interfaceName}Manager.java" )
  -    #set ( $path = "${strings.getPackageAsPath($package)}$fname" )    
  +    #set ( $path = "${strings.getPackageAsPath($package)}$fname" )
       #if (!$files.file($basePath,$path).exists())
         $generator.parse("om/ExtensionManager.vm",$path,"table",$tbl)
       #end
  @@ -77,7 +77,7 @@
   #end
   
       #set ( $fname = "${firstcap}.java" )
  -    #set ( $path = "${strings.getPackageAsPath($package)}$fname" )    
  +    #set ( $path = "${strings.getPackageAsPath($package)}$fname" )
       #if (!$files.file($basePath,$path).exists())
         $generator.parse("om/ExtensionObject.vm",$path,"table",$tbl)
       #end
  
  
  
  1.55      +12 -12    jakarta-turbine-torque/src/templates/om/Object.vm
  
  Index: Object.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-torque/src/templates/om/Object.vm,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- Object.vm	16 Nov 2002 11:27:50 -0000	1.54
  +++ Object.vm	11 Dec 2002 19:03:41 -0000	1.55
  @@ -1169,7 +1169,7 @@
   #set ( $argList = "" )
   #set ( $argList2 = "" )
   #set ( $comma = "" )
  -#foreach ($col in $table.PrimaryKeys)
  +#foreach ($col in $table.PrimaryKey)
       #if ($complexObjectModel)
           #if ( $col.isForeignKey() || ($col.Referrers.size() > 0) )
               #set ( $throwsClause = "throws TorqueException" )
  @@ -1184,9 +1184,9 @@
       #set ( $comma = "," )
   #end
   
  -#if ($table.PrimaryKeys.size() == 1)
  +#if ($table.PrimaryKey.size() == 1)
   
  -    #set ($col = $table.PrimaryKeys.get(0) )
  +    #set ($col = $table.PrimaryKey.get(0) )
       #set ( $clo=$col.Name.toLowerCase() )
       #set ( $cjtype= $col.JavaNative )
       /**
  @@ -1274,9 +1274,9 @@
           #end
       }
   
  -#elseif ($table.PrimaryKeys.size() > 1)
  +#elseif ($table.PrimaryKey.size() > 1)
   
  -    private final SimpleKey[] pks = new SimpleKey[$table.PrimaryKeys.size()];
  +    private final SimpleKey[] pks = new SimpleKey[$table.PrimaryKey.size()];
       private final ComboKey comboPK = new ComboKey(pks);
       /**
        * Set the PrimaryKey with an ObjectKey
  @@ -1288,7 +1288,7 @@
           SimpleKey[] keys = (SimpleKey[]) key.getValue();
           SimpleKey tmpKey = null;
        #set ($i = 0)
  -    #foreach ($pk in $table.PrimaryKeys)
  +    #foreach ($pk in $table.PrimaryKey)
           #set ($pktype = $pk.JavaNative)
           #if ($pktype == "short")
               set${pk.JavaName}(((NumberKey)keys[$i]).shortValue());
  @@ -1328,7 +1328,7 @@
       /**
        * Set the PrimaryKey using SimpleKeys.
        *
  -#foreach ($col in $table.PrimaryKeys)
  +#foreach ($col in $table.PrimaryKey)
       #set ( $clo=$col.Name.toLowerCase() )
       #set ( $cjtype= $col.JavaNative )
        * @param $cjtype $clo
  @@ -1337,7 +1337,7 @@
       public void setPrimaryKey($argList)
           $throwsClause
       {
  -#foreach ($col in $table.PrimaryKeys)
  +#foreach ($col in $table.PrimaryKey)
            set${col.JavaName}($col.Name.toLowerCase());
   #end
       }
  @@ -1358,11 +1358,11 @@
        */
       public ObjectKey getPrimaryKey()
       {
  -#if ($table.PrimaryKeys.size() == 1)
  -        return SimpleKey.keyFor(get${table.PrimaryKeys.get(0).JavaName}());
  -#elseif ($table.PrimaryKeys.size() > 1)
  +#if ($table.PrimaryKey.size() == 1)
  +        return SimpleKey.keyFor(get${table.PrimaryKey.get(0).JavaName}());
  +#elseif ($table.PrimaryKey.size() > 1)
       #set ($i = 0)
  -    #foreach ($pk in $table.PrimaryKeys)
  +    #foreach ($pk in $table.PrimaryKey)
           pks[$i] = SimpleKey.keyFor(get${pk.JavaName}());
           #set ($i = $i +1)
       #end
  
  
  
  1.30      +14 -14    jakarta-turbine-torque/src/templates/om/ObjectWithManager.vm
  
  Index: ObjectWithManager.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-torque/src/templates/om/ObjectWithManager.vm,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- ObjectWithManager.vm	16 Nov 2002 11:27:50 -0000	1.29
  +++ ObjectWithManager.vm	11 Dec 2002 19:03:41 -0000	1.30
  @@ -1083,7 +1083,7 @@
                   ${table.JavaName}Peer.doUpdate(($table.JavaName)this, con);
               }
   
  -#if ($table.PrimaryKeys.size() > 0)
  +#if ($table.PrimaryKey.size() > 0)
       #set ($interfaceName = $table.JavaName)
       #if ($table.Interface)
           #set ($interfaceName = $table.Interface)
  @@ -1132,7 +1132,7 @@
       }
   #end
   
  -#if ($table.PrimaryKeys.size() > 0)
  +#if ($table.PrimaryKey.size() > 0)
       /**
        * Specify whether to cache the object after saving to the db.
        * This method returns false
  @@ -1150,7 +1150,7 @@
   #set ( $argList = "" )
   #set ( $argList2 = "" )
   #set ( $comma = "" )
  -#foreach ($col in $table.PrimaryKeys)
  +#foreach ($col in $table.PrimaryKey)
       #if ($complexObjectModel)
           #if ( $col.isForeignKey() || ($col.Referrers.size() > 0) )
               #set ( $throwsClause = "throws TorqueException" )
  @@ -1165,9 +1165,9 @@
       #set ( $comma = "," )
   #end
   
  -#if ($table.PrimaryKeys.size() == 1)
  +#if ($table.PrimaryKey.size() == 1)
   
  -    #set ($col = $table.PrimaryKeys.get(0) )
  +    #set ($col = $table.PrimaryKey.get(0) )
       #set ( $clo=$col.Name.toLowerCase() )
       #set ( $cjtype= $col.JavaNative )
       /**
  @@ -1252,9 +1252,9 @@
           #end
       }
   
  -#elseif ($table.PrimaryKeys.size() > 1)
  +#elseif ($table.PrimaryKey.size() > 1)
   
  -    private final SimpleKey[] pks = new SimpleKey[$table.PrimaryKeys.size()];
  +    private final SimpleKey[] pks = new SimpleKey[$table.PrimaryKey.size()];
       private final ComboKey comboPK = new ComboKey(pks);
       /**
        * Set the PrimaryKey with an ObjectKey
  @@ -1264,7 +1264,7 @@
            SimpleKey[] keys = (SimpleKey[]) key.getValue();
           SimpleKey tmpKey = null;
        #set ($i = 0)
  -    #foreach ($pk in $table.PrimaryKeys)
  +    #foreach ($pk in $table.PrimaryKey)
           #set ($pktype = $pk.JavaNative)
           #if ($pktype == "short")
               set${pk.JavaName}(((NumberKey)keys[$i]).shortValue());
  @@ -1304,7 +1304,7 @@
       /**
        * Set the PrimaryKey using SimpleKeys.
        *
  -#foreach ($col in $table.PrimaryKeys)
  +#foreach ($col in $table.PrimaryKey)
       #set ( $clo=$col.Name.toLowerCase() )
       #set ( $cjtype= $col.JavaNative )
        * @param $cjtype $clo
  @@ -1312,7 +1312,7 @@
        */
       public void setPrimaryKey($argList)
           $throwsClause {
  -#foreach ($col in $table.PrimaryKeys)
  +#foreach ($col in $table.PrimaryKey)
            set${col.JavaName}($col.Name.toLowerCase());
   #end
       }
  @@ -1334,11 +1334,11 @@
        */
       public ObjectKey getPrimaryKey()
       {
  -#if ($table.PrimaryKeys.size() == 1)
  -        return SimpleKey.keyFor(get${table.PrimaryKeys.get(0).JavaName}());
  -#elseif ($table.PrimaryKeys.size() > 1)
  +#if ($table.PrimaryKey.size() == 1)
  +        return SimpleKey.keyFor(get${table.PrimaryKey.get(0).JavaName}());
  +#elseif ($table.PrimaryKey.size() > 1)
       #set ($i = 0)
  -    #foreach ($pk in $table.PrimaryKeys)
  +    #foreach ($pk in $table.PrimaryKey)
           pks[$i] = SimpleKey.keyFor(get${pk.JavaName}());
           #set ($i = $i +1)
       #end
  
  
  
  1.46      +17 -17    jakarta-turbine-torque/src/templates/om/Peer.vm
  
  Index: Peer.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-torque/src/templates/om/Peer.vm,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- Peer.vm	27 Nov 2002 13:24:04 -0000	1.45
  +++ Peer.vm	11 Dec 2002 19:03:41 -0000	1.46
  @@ -825,7 +825,7 @@
        */
       public static void doInsert($table.JavaName obj) throws TorqueException
       {
  -        #if ($table.IdMethod.equals("none") || $table.PrimaryKeys.size() == 0)
  +        #if ($table.IdMethod.equals("none") || $table.PrimaryKey.size() == 0)
           doInsert(buildCriteria(obj));
           #else
           obj.setPrimaryKey(doInsert(buildCriteria(obj)));
  @@ -868,7 +868,7 @@
       public static void doInsert($table.JavaName obj, Connection con)
           throws TorqueException
       {
  -        #if ($table.IdMethod.equals("none") || $table.PrimaryKeys.size() == 0)
  +        #if ($table.IdMethod.equals("none") || $table.PrimaryKey.size() == 0)
           doInsert(buildCriteria(obj), con);
           #else
           obj.setPrimaryKey(doInsert(buildCriteria(obj), con));
  @@ -943,12 +943,12 @@
       public static Criteria buildCriteria( ObjectKey pk )
       {
           Criteria criteria = new Criteria();
  -  #if ($table.PrimaryKeys.size() == 1)
  -            criteria.add($table.PrimaryKeys.get(0).Name.toUpperCase(), pk);
  +  #if ($table.PrimaryKey.size() == 1)
  +            criteria.add($table.PrimaryKey.get(0).Name.toUpperCase(), pk);
     #else
           SimpleKey[] keys = (SimpleKey[])pk.getValue();
       #set ( $i = 0 )
  -    #foreach ($col in $table.PrimaryKeys)
  +    #foreach ($col in $table.PrimaryKey)
           #set ( $cup=$col.Name.toUpperCase() )
               criteria.add($cup, keys[$i]);
           #set ( $i = $i + 1 )
  @@ -974,7 +974,7 @@
   
   #end ## ends if (!$table.isAlias())
   
  -#if ($table.PrimaryKeys.size() > 0)
  +#if ($table.PrimaryKey.size() > 0)
   
     #if ($table.isAlias())
       #set ($retrieveMethod = "retrieve${table.JavaName}ByPK")
  @@ -1089,8 +1089,8 @@
           else
           {
               Criteria criteria = new Criteria();
  -  #if ($table.PrimaryKeys.size() == 1)
  -            criteria.addIn( $table.PrimaryKeys.get(0).Name.toUpperCase(), pks );
  +  #if ($table.PrimaryKey.size() == 1)
  +            criteria.addIn( $table.PrimaryKey.get(0).Name.toUpperCase(), pks );
     #else
               Iterator iter = pks.iterator();
               while (iter.hasNext())
  @@ -1098,7 +1098,7 @@
                   ObjectKey pk = (ObjectKey)iter.next();
                   SimpleKey[] keys = (SimpleKey[])pk.getValue();
                   #set ( $i = 0 )
  -                #foreach ($col in $table.PrimaryKeys)
  +                #foreach ($col in $table.PrimaryKey)
                       #set ( $cup=$col.Name.toUpperCase() )
                       Criteria.Criterion c$i = criteria.getNewCriterion(
                           $cup, keys[$i], Criteria.EQUAL);
  @@ -1116,21 +1116,21 @@
           return objs;
       }
   
  -#end ## ends if($table.PrimaryKeys.size() > 0)
  +#end ## ends if($table.PrimaryKey.size() > 0)
   
  -#if ($table.PrimaryKeys.size() > 1)
  +#if ($table.PrimaryKey.size() > 1)
   #set ( $comma = false )
       /**
        * retrieve object using using pk values.
        *
  -#foreach ($col in $table.PrimaryKeys)
  +#foreach ($col in $table.PrimaryKey)
       #set ( $clo=$col.Name.toLowerCase() )
       #set ( $cjtype= $col.JavaNative )
        * @param $clo $cjtype
   #end
        */
       public static $table.JavaName ${retrieveMethod}(
  -#foreach ($col in $table.PrimaryKeys)
  +#foreach ($col in $table.PrimaryKey)
       #set ( $clo=$col.Name.toLowerCase() )
       #set ( $cjtype = $col.JavaNative )
       #if ($comma),#end $cjtype $clo
  @@ -1145,7 +1145,7 @@
              db = Torque.getConnection(DATABASE_NAME);
              retVal = retrieveByPK(
              #set ( $comma = false )
  -           #foreach ($col in $table.PrimaryKeys)
  +           #foreach ($col in $table.PrimaryKey)
                  #set ( $clo=$col.Name.toLowerCase() )
                  #if ($comma),#end $clo
                  #set ( $comma = true )
  @@ -1163,7 +1163,7 @@
       /**
        * retrieve object using using pk values.
        *
  -#foreach ($col in $table.PrimaryKeys)
  +#foreach ($col in $table.PrimaryKey)
       #set ( $clo=$col.Name.toLowerCase() )
       #set ( $cjtype= $col.JavaNative )
        * @param $clo $cjtype
  @@ -1171,7 +1171,7 @@
        * @param Connection con
        */
       public static $table.JavaName ${retrieveMethod}(
  -#foreach ($col in $table.PrimaryKeys)
  +#foreach ($col in $table.PrimaryKey)
       #set ( $clo=$col.Name.toLowerCase() )
       #set ( $cjtype = $col.JavaNative )
       #if ($comma),#end $cjtype $clo
  @@ -1181,7 +1181,7 @@
       {
   
           Criteria criteria = new Criteria(5);
  -#foreach ($col in $table.PrimaryKeys)
  +#foreach ($col in $table.PrimaryKey)
       #set ( $cup=$col.Name.toUpperCase() )
       #set ( $clo=$col.Name.toLowerCase() )
           criteria.add($cup, $clo);