db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject cvs commit: db-torque/src/generator/src/templates/om Object.vm
Date Wed, 16 Mar 2005 07:15:07 GMT
tfischer    2005/03/15 23:15:07

  Modified:    src/generator/src/templates/om Object.vm
  Log:
  Removed some tabs, adjusted spaces
  moved one velocity statement to match the position in ObjectWithManager.vm
  
  Revision  Changes    Path
  1.23      +74 -74    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.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- Object.vm	14 Mar 2005 09:21:40 -0000	1.22
  +++ Object.vm	16 Mar 2005 07:15:07 -0000	1.23
  @@ -121,7 +121,7 @@
        *
        * @return $cjtype
        */
  -    public $cjtype ${col.GetterName} ()
  +    public $cjtype ${col.GetterName}()
       {
           return $clo;
       }
  @@ -222,7 +222,7 @@
               for (int i = 0; i < ${collName}.size(); i++)
               {
                   ((${tblFK.JavaName}) ${collName}.get(i))
  -                    .${colFK.SetterName}(v);
  +                        .${colFK.SetterName}(v);
               }
           }
             #end
  @@ -373,85 +373,85 @@
        */
       public void set${pVarName}Key(ObjectKey key) throws TorqueException
       {
  -      #if ($fk.LocalColumns.size() > 1)
  +    #if ($fk.LocalColumns.size() > 1)
           SimpleKey[] keys = (SimpleKey[]) key.getValue();
  -        #set ($i = 0)
  -        #foreach ($colName in $fk.LocalColumns)
  -          #set ($col = $table.getColumn($colName) )
  -
  -          #set ($fktype = $col.JavaNative)
  -          #if ($fktype == "short")
  +      #set ($i = 0)
  +      #foreach ($colName in $fk.LocalColumns)
  +        #set ($col = $table.getColumn($colName) )
  +        #set ($fktype = $col.JavaNative)
  +        #if ($fktype == "short")
           ${col.SetterName}(((NumberKey) keys[$i]).shortValue());
  -          #elseif($fktype == "int")
  +        #elseif($fktype == "int")
           ${col.SetterName}(((NumberKey) keys[$i]).intValue());
  -          #elseif($fktype == "long")
  +        #elseif($fktype == "long")
           ${col.SetterName}(((NumberKey) keys[$i]).longValue());
  -          #elseif($fktype == "BigDecimal")
  +        #elseif($fktype == "BigDecimal")
           ${col.SetterName}(((NumberKey) keys[$i]).getBigDecimal());
  -          #elseif($fktype == "byte")
  +        #elseif($fktype == "byte")
           ${col.SetterName}(((NumberKey) keys[$i]).byteValue());
  -          #elseif($fktype == "float")
  +        #elseif($fktype == "float")
           ${col.SetterName}(((NumberKey) keys[$i]).floatValue());
  -          #elseif($fktype == "double")
  +        #elseif($fktype == "double")
           ${col.SetterName}(((NumberKey) keys[$i]).doubleValue());
  -          #elseif($fktype == "Short")
  +        #elseif($fktype == "Short")
           ${col.SetterName}(new Short(((NumberKey) keys[$i]).shortValue()));
  -          #elseif($fktype == "Integer")
  +        #elseif($fktype == "Integer")
           ${col.SetterName}(new Integer(((NumberKey) keys[$i]).intValue()));
  -          #elseif($fktype == "Long")
  +        #elseif($fktype == "Long")
           ${col.SetterName}(new Long(((NumberKey) keys[$i]).longValue()));
  -          #elseif($fktype == "Byte")
  +        #elseif($fktype == "Byte")
           ${col.SetterName}(new Byte(((NumberKey) keys[$i]).byteValue()));
  -          #elseif($fktype == "Float")
  +        #elseif($fktype == "Float")
           ${col.SetterName}(new Float(((NumberKey) keys[$i]).floatValue()));
  -          #elseif($fktype == "Double")
  +        #elseif($fktype == "Double")
           ${col.SetterName}(new Double(((NumberKey) keys[$i]).doubleValue()));
  -          #elseif($fktype == "String")
  +        #elseif($fktype == "String")
           ${col.SetterName}(keys[$i].toString());
  -          #elseif($fktype == "Date")
  +        #elseif($fktype == "Date")
           ${col.SetterName}(((DateKey)keys[$i]).getDate());
  -          #end
  -          #set ( $i = $i + 1 )
           #end
  -      #else
  -        #set ($colName = $fk.LocalColumns.get(0))
  -        #set ($col = $table.getColumn($colName) )
   
  -        #set ($fktype = $col.JavaNative)
  -        #if ($fktype == "short")
  +        #set ( $i = $i + 1 )
  +      #end
  +    #else
  +      #set ($colName = $fk.LocalColumns.get(0))
  +      #set ($col = $table.getColumn($colName) )
  +
  +      #set ($fktype = $col.JavaNative)
  +      #if ($fktype == "short")
           ${col.SetterName}(((NumberKey) key).shortValue());
  -        #elseif($fktype == "int")
  +      #elseif($fktype == "int")
           ${col.SetterName}(((NumberKey) key).intValue());
  -        #elseif($fktype == "long")
  +      #elseif($fktype == "long")
           ${col.SetterName}(((NumberKey) key).longValue());
  -        #elseif($fktype == "BigDecimal")
  +      #elseif($fktype == "BigDecimal")
           ${col.SetterName}(((NumberKey) key).getBigDecimal());
  -        #elseif($fktype == "byte")
  +      #elseif($fktype == "byte")
           ${col.SetterName}(((NumberKey) key).byteValue());
  -        #elseif($fktype == "float")
  +      #elseif($fktype == "float")
           ${col.SetterName}(((NumberKey) key).floatValue());
  -        #elseif($fktype == "double")
  +      #elseif($fktype == "double")
           ${col.SetterName}(((NumberKey) key).doubleValue());
  -        #elseif($fktype == "Short")
  +      #elseif($fktype == "Short")
           ${col.SetterName}(new Short(((NumberKey) key).shortValue()));
  -        #elseif($fktype == "Integer")
  +      #elseif($fktype == "Integer")
           ${col.SetterName}(new Integer(((NumberKey) key).intValue()));
  -        #elseif($fktype == "Long")
  +      #elseif($fktype == "Long")
           ${col.SetterName}(new Long(((NumberKey) key).longValue()));
  -        #elseif($fktype == "Byte")
  +      #elseif($fktype == "Byte")
           ${col.SetterName}(new Byte(((NumberKey) key).byteValue()));
  -        #elseif($fktype == "Float")
  +      #elseif($fktype == "Float")
           ${col.SetterName}(new Float(((NumberKey) key).floatValue()));
  -        #elseif($fktype == "Double")
  +      #elseif($fktype == "Double")
           ${col.SetterName}(new Double(((NumberKey) key).doubleValue()));
  -        #elseif($fktype == "String")
  +      #elseif($fktype == "String")
           ${col.SetterName}(key.toString());
  -        #elseif($fktype == "Date")
  +      #elseif($fktype == "Date")
           ${col.SetterName}(((DateKey)key).getDate());
  -        #end
         #end
  +    #end
       }
  -    #end   ## end of foreach loop over foreign keys
  +  #end   ## end of foreach loop over foreign keys
   
     ##
     ## setup foreign key associations
  @@ -498,10 +498,10 @@
           }
       }
   
  -    #set ($interfaceName = $table.JavaName)
  -    #if ($table.Interface)
  -      #set ($interfaceName = $table.Interface)
  -    #end
  +        #set ($interfaceName = $table.JavaName)
  +        #if ($table.Interface)
  +          #set ($interfaceName = $table.Interface)
  +        #end
   
       /**
        * Method called to associate a $tblFK.JavaName object to this object
  @@ -589,7 +589,7 @@
                   // the following code is to determine if a new query is
                   // called for.  If the criteria is the same as the last
                   // one, just return the collection.
  -      #end  
  +      #end
         #foreach ($columnName in $fk.ForeignColumns)
           #set ( $column = $table.getColumn($columnName) )
           #set ( $colFKName = $fk.ForeignLocalMapping.get($columnName) )
  @@ -843,7 +843,7 @@
       #else
        * If this $table.JavaName is new, this method will return
       #end
  -    * an empty collection; or if this $table.JavaName has previously
  +     * an empty collection; or if this $table.JavaName has previously
        * been saved, it will retrieve related ${relCol} from storage.
        *
        * This method is protected by default in order to keep the public
  @@ -862,12 +862,12 @@
               }
               else
               {
  -     #foreach ($columnName in $fk.ForeignColumns)
  -         #set ( $column = $table.getColumn($columnName) )
  -         #set ( $colFKName = $fk.ForeignLocalMapping.get($columnName) )
  -         #set ( $colFK = $tblFK.getColumn($colFKName) )
  +      #foreach ($columnName in $fk.ForeignColumns)
  +        #set ( $column = $table.getColumn($columnName) )
  +        #set ( $colFKName = $fk.ForeignLocalMapping.get($columnName) )
  +        #set ( $colFK = $tblFK.getColumn($colFKName) )
                   criteria.add(${className}Peer.${colFK.Name.toUpperCase()}, ${column.GetterName}());
  -     #end
  +      #end
                   $collName = ${className}Peer.doSelectJoinAllExcept${table.JavaName}${suffix}(criteria);
               }
           }
  @@ -876,15 +876,15 @@
               // the following code is to determine if a new query is
               // called for.  If the criteria is the same as the last
               // one, just return the collection.
  -   #end
  +    #end
   
  -   #foreach ($columnName in $fk.ForeignColumns)
  -       #set ( $column = $table.getColumn($columnName) )
  -       #set ( $colFKName = $fk.ForeignLocalMapping.get($columnName) )
  -       #set ( $colFK = $tblFK.getColumn($colFKName) )
  +    #foreach ($columnName in $fk.ForeignColumns)
  +      #set ( $column = $table.getColumn($columnName) )
  +      #set ( $colFKName = $fk.ForeignLocalMapping.get($columnName) )
  +      #set ( $colFK = $tblFK.getColumn($colFKName) )
                   criteria.add(${className}Peer.${colFK.Name.toUpperCase()}, ${column.GetterName}());
  -   #end
  -   #if ($objectIsCaching)
  +    #end
  +    #if ($objectIsCaching)
               if (!last${relCol}Criteria.equals(criteria))
               {
                   $collName = ${className}Peer.doSelectJoinAllExcept${table.JavaName}${suffix}(criteria);
  @@ -893,9 +893,9 @@
           last${relCol}Criteria = criteria;
   
           return $collName;
  -   #else 
  -            return ${className}Peer.doSelectJoinAllExcept${table.JavaName}${suffix}(criteria);
  -   #end
  +    #else 
  +        return ${className}Peer.doSelectJoinAllExcept${table.JavaName}${suffix}(criteria);
  +    #end
       }
   
     #end
  @@ -1172,11 +1172,6 @@
   *#
     #end
   
  -  #if ($table.PrimaryKey.size() > 0)
  -    #set ($tableHasPrimaryKey = true)
  -  #else
  -    #set ($tableHasPrimaryKey = false)
  -  #end
               // If this object has been modified, then save it to the database.
               if (isModified())
               {
  @@ -1189,6 +1184,11 @@
                   {
                       ${table.JavaName}Peer.doUpdate(($table.JavaName) this, con);
                   }
  +  #if ($table.PrimaryKey.size() > 0)
  +    #set ($tableHasPrimaryKey = true)
  +  #else
  +    #set ($tableHasPrimaryKey = false)
  +  #end
               }
   
     #if ($complexObjectModel)
  @@ -1504,8 +1504,8 @@
     #foreach ($col in $table.Columns)
       #if ($col.isPrimaryKey())
         #if($col.Primitive)
  -		#set ($fktype = $col.JavaNative)
  -	    #set ($casttype = "")
  +        #set ($fktype = $col.JavaNative)
  +        #set ($casttype = "")
           #if ($fktype == "short")
             #set ($casttype = "(short)")
           #elseif($fktype == "byte")
  
  
  

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