db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpoes...@apache.org
Subject cvs commit: db-torque/src/generator/src/templates/data/dump Control.vm
Date Sun, 03 Aug 2003 13:42:40 GMT
mpoeschl    2003/08/03 06:42:40

  Modified:    src/rttest bookstore-schema.xml
               xdocs    changes.xml
               src/rttest/org/apache/torque DataTest.java
               src/generator/src/templates/data/dump Control.vm
  Log:
  TRQS51: Datadump does not recognize null columns properly
  dump/Control.vm: check if the value is null ($set keeps the old value if it is set to null)
  
  Revision  Changes    Path
  1.13      +18 -0     db-torque/src/rttest/bookstore-schema.xml
  
  Index: bookstore-schema.xml
  ===================================================================
  RCS file: /home/cvs/db-torque/src/rttest/bookstore-schema.xml,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- bookstore-schema.xml	1 Aug 2003 08:24:30 -0000	1.12
  +++ bookstore-schema.xml	3 Aug 2003 13:42:40 -0000	1.13
  @@ -67,6 +67,24 @@
     </table>
   
   
  +  <!-- =================================================== -->
  +  <!-- T E S T   T A B L E                                 -->
  +  <!-- =================================================== -->
  +
  +  <!-- TRQS51 Datadump does not recognize null columns properly -->
  +  <table name="NULL_VALUE_TABLE" 
  +         description="table containing null values to test datadump">
  +    <column name="NULL_VALUE_TABLE_ID" primaryKey="true" required="true" type="INTEGER"/>
  +    <column name="number1" type="INTEGER"/>
  +    <column name="number2" type="INTEGER"/>
  +    <column name="number3" type="INTEGER"/>
  +    <column name="text1" type="VARCHAR" size="20"/>
  +    <column name="text2" type="VARCHAR" size="20"/>
  +    <column name="number_obj1" type="INTEGER" javaType="object"/>
  +    <column name="number_obj2" type="INTEGER" javaType="object"/>
  +  	
  +  </table>
  +
   
     <!-- =================================================== -->
     <!-- A  T A B L E                                        -->
  
  
  
  1.96      +3 -0      db-torque/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/db-torque/xdocs/changes.xml,v
  retrieving revision 1.95
  retrieving revision 1.96
  diff -u -r1.95 -r1.96
  --- changes.xml	18 Jul 2003 22:03:33 -0000	1.95
  +++ changes.xml	3 Aug 2003 13:42:40 -0000	1.96
  @@ -34,6 +34,9 @@
   <p>
     <ul>
       <li>
  +      TRQS51: Datadump does not recognize null columns properly
  +    </li>
  +    <li>
         TRQS152: Oracle DB using Criteria to select by Data doesn't work
       </li>
     </ul>
  
  
  
  1.7       +19 -1     db-torque/src/rttest/org/apache/torque/DataTest.java
  
  Index: DataTest.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/rttest/org/apache/torque/DataTest.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DataTest.java	21 Mar 2003 17:31:08 -0000	1.6
  +++ DataTest.java	3 Aug 2003 13:42:40 -0000	1.7
  @@ -61,6 +61,7 @@
   import org.apache.torque.test.Author;
   import org.apache.torque.test.Book;
   import org.apache.torque.test.BookPeer;
  +import org.apache.torque.test.NullValueTable;
   import org.apache.torque.util.Criteria;
   import org.apache.torque.test.MultiPk;
   
  @@ -174,5 +175,22 @@
           {
               ex.printStackTrace();
           }
  +    }
  +    
  +    public void testDataDump()
  +    {
  +		try
  +		{
  +	    	NullValueTable nvt = new NullValueTable();
  +    		nvt.setNumber1(1);
  +	    	nvt.setNumber3(3);
  +    		nvt.setText1("text");
  +    		nvt.setNumberObj1(new Integer(1));
  +    		nvt.save();
  +		}
  +		catch (Exception ex)
  +		{
  +			ex.printStackTrace();
  +		}
       }
   }
  
  
  
  1.2       +2 -2      db-torque/src/generator/src/templates/data/dump/Control.vm
  
  Index: Control.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/data/dump/Control.vm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Control.vm	10 Feb 2003 13:18:44 -0000	1.1
  +++ Control.vm	3 Aug 2003 13:42:40 -0000	1.2
  @@ -22,8 +22,8 @@
       #foreach ($r in $tableTool.fetch($tbl.Name)).##
           #set ($rout = "<$tbl.JavaName")
           #foreach ($col in $tbl.Columns)
  -            #set ($cval = $r.get($col.Name))
  -            #if ($cval)
  +            #if ($r.get($col.Name))
  +                #set ($cval = $r.get($col.Name))
                   #set ($rout = "$rout ${col.JavaName}=$q$escape.getText($cval)$q")
               #end
           #end
  
  
  

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