[DB Torque Wiki] Updated: TorqueFuture

2004-12-27 Thread torque-dev
   Date: 2004-12-27T05:46:05
   Editor: CharlesSabourdin
   Wiki: DB Torque Wiki
   Page: TorqueFuture
   URL: http://wiki.apache.org/db-torque/TorqueFuture

   no comment

Change Log:

--
@@ -56,6 +56,9 @@
 
  * Provide extra methods that clear down or invalidate all the supplementary 
fields such as the 'collXXX' arising from foreign keys. (RM)
 
+ *  Generate struts pages. the idea would be to create a jsp pages form with 
all the fields by pages, the struts-config.xml, the validator-rules.xml and the 
{table}Form.java and {table}Action.java. this looks like Xdoclet but this could 
be great
+
+
 == Maven Plugin ==
 
  * Generalize into a code generator plugin? (hps)

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



cvs commit: db-torque/src/rttest/org/apache/torque DataTest.java

2004-12-27 Thread tfischer
tfischer2004/12/27 11:52:48

  Modified:src/rttest Tag: TORQUE_3_1_BRANCH bookstore-schema.xml
   src/rttest/org/apache/torque Tag: TORQUE_3_1_BRANCH
DataTest.java
  Log:
  added a test case where the accuracy of date/time/timestamp values are 
checked. For this, a new table was added to the bookstore schema.
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.13.2.1  +29 -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.13
  retrieving revision 1.13.2.1
  diff -u -r1.13 -r1.13.2.1
  --- bookstore-schema.xml  3 Aug 2003 13:42:40 -   1.13
  +++ bookstore-schema.xml  27 Dec 2004 19:52:47 -  1.13.2.1
  @@ -245,5 +245,34 @@
 reference foreign=COL2 local=PARENT_COL2/
   /foreign-key
 /table
  +  
  +  !-- === --
  +  !-- D A T E _ T E S T  T A B L E--
  +  !-- === --
  +
  +  table name=DATE_TEST description=Table to test Date formats
  +column
  +  name=DATE_TEST_ID
  +  required=true
  +  primaryKey=true
  +  type=INTEGER
  +/
  +column
  +  name=DATE_VALUE
  +  required=true
  +  type=DATE
  +/
  +column
  +  name=TIME_VALUE
  +  required=true
  +  type=TIME
  +/
  +column
  +  name=TIMESTAMP_VALUE
  +  required=true
  +  type=TIMESTAMP
  +/
  +
  +  /table
   
   /database
  
  
  
  No   revision
  No   revision
  1.8.2.6   +79 -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.8.2.5
  retrieving revision 1.8.2.6
  diff -u -r1.8.2.5 -r1.8.2.6
  --- DataTest.java 16 Dec 2004 08:04:36 -  1.8.2.5
  +++ DataTest.java 27 Dec 2004 19:52:47 -  1.8.2.6
  @@ -16,6 +16,9 @@
* limitations under the License.
*/
   
  +import java.text.DateFormat;
  +import java.text.SimpleDateFormat;
  +import java.util.Date;
   import java.util.HashMap;
   import java.util.Iterator;
   import java.util.List;
  @@ -28,6 +31,8 @@
   import org.apache.torque.test.BookPeer;
   import org.apache.torque.test.BooleanCheck;
   import org.apache.torque.test.BooleanCheckPeer;
  +import org.apache.torque.test.DateTest;
  +import org.apache.torque.test.DateTestPeer;
   import org.apache.torque.test.MultiPk;
   import org.apache.torque.test.MultiPkPeer;
   import org.apache.torque.test.NullValueTable;
  @@ -764,6 +769,79 @@
   }
   }
   catch( Exception e) 
  +{
  +e.printStackTrace();
  +fail(Exception caught :  
  + + e.getClass().getName() 
  + +  :  + e.getMessage());
  +}
  +}
  +
  +/**
  + * Tests the date, time and datetime accuracy.
  + * At the moment, no upper limit for the accuracy is checked,
  + * the differences are printed to stdout.
  + */
  +public void testDateTime() 
  +{
  +try
  +{
  +// clean Date table
  +Criteria criteria = new Criteria();
  +criteria.add(
  +DateTestPeer.DATE_TEST_ID, 
  +(Long) null, 
  +Criteria.NOT_EQUAL);
  +DateTestPeer.doDelete(criteria);
  +
  +// insert new DateTest object to db
  +DateTest dateTest = new DateTest();
  +Date now = new Date();
  +dateTest.setDateValue(now);
  +dateTest.setTimeValue(now);
  +dateTest.setTimestampValue(now);
  +dateTest.save();
  +DateFormat dateFormat = new SimpleDateFormat();
  +System.out.println(
  +testDateTime() : set date to :  
  ++ dateFormat.format(now));
  +
  +// reload dateTest from db
  +DateTest loadedDateTest 
  += DateTestPeer.retrieveByPK(dateTest.getPrimaryKey());
  +
  +System.out.println(
  +testDateTime() : retrieved date :  
  ++ dateFormat.format(loadedDateTest.getDateValue()));
  +System.out.println(
  +testDateTime() : retrieved time :  
  ++ dateFormat.format(loadedDateTest.getTimeValue()));
  +System.out.println(
  +testDateTime() : retrieved timestamp :  
  ++ dateFormat.format(loadedDateTest.getTimestampValue()));
 

accuracy of TIME columns

2004-12-27 Thread Thomas Fischer




Hi,

I am currently checking a bug report
(http://nagoya.apache.org/scarab/issues/id/TRQS263). I am investigating the
accuracy of TIME columns. The problem is that saving a TIME value and
retrieving it again from an Oracle DB only has day accuracy, not second
accuracy as one would expect from the SQL type TIME.
While stepping through the code, I have come to the conclusion that this
problem might not be a oracle problem, but might also occur in other
databases. To check this, I have just committed a test case to CVS branch
TORQUE_3_1_BRANCH. Can anyone whoe does _NOT_ use oracle please check this
out and run the runtime-tests? At some point, there should be output like

testDateTime() : set date to : 27.12.04 21:02
testDateTime() : retrieved date : 27.12.04 00:00
testDateTime() : retrieved time : 27.12.04 00:00
testDateTime() : retrieved timestamp : 27.12.04 21:02
testDateTime() : Date difference (ms): 75736298
testDateTime() : Time difference (ms): 75736298
testDateTime() : Timestamp difference (ms): 0

The crucial point is whether the TimeDifference is below 1000 or not.

 Thanks a lot,

  Thomas


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