db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g.@apache.org
Subject svn commit: r1869848 - in /db/torque/torque4/trunk: torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java torque-test/pom.xml torque-test/src/test/java/org/apache/torque/datatypes/DateTimeTimestampTest.java
Date Fri, 15 Nov 2019 10:42:21 GMT
Author: gk
Date: Fri Nov 15 10:42:21 2019
New Revision: 1869848

URL: http://svn.apache.org/viewvc?rev=1869848&view=rev
Log:
- fix time mapping in peer and torque-test (hsqldb, mysql tested)
- update mysql connector v8.0.18

Modified:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
    db/torque/torque4/trunk/torque-test/pom.xml
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/DateTimeTimestampTest.java

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java?rev=1869848&r1=1869847&r2=1869848&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/util/BasePeerImpl.java
Fri Nov 15 10:42:21 2019
@@ -1794,6 +1794,11 @@ public class BasePeerImpl<T> implements
                 statement.setDate(i, (java.sql.Date) param);
                 result.add(param);
             }
+            else if (param instanceof java.sql.Time)
+            {
+                statement.setTime(i, (java.sql.Time) param);
+                result.add(param);
+            }
             else if (param instanceof java.util.Date)
             {
                 java.sql.Timestamp sqlDate = new java.sql.Timestamp(

Modified: db/torque/torque4/trunk/torque-test/pom.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/pom.xml?rev=1869848&r1=1869847&r2=1869848&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/pom.xml (original)
+++ db/torque/torque4/trunk/torque-test/pom.xml Fri Nov 15 10:42:21 2019
@@ -50,7 +50,7 @@
     <torque.test.derby.version>10.14.2.0</torque.test.derby.version>
     <torque.test.hsqldb.version>2.3.1</torque.test.hsqldb.version><!-- 2.5.0
as of june 2019 -->
     <torque.test.mssql.version>1.2.7</torque.test.mssql.version>
-    <torque.test.mysql.version>8.0.13</torque.test.mysql.version>
+    <torque.test.mysql.version>8.0.18</torque.test.mysql.version><!-- 5.1.48
, 8.0.18-->
     <torque.test.mysql.log4j2.version>2.12.1</torque.test.mysql.log4j2.version>
     <torque.test.oracle.version>10.2.0.3.0</torque.test.oracle.version>
     <torque.test.postgres.version>9.1-901.jdbc4</torque.test.postgres.version>
@@ -495,7 +495,7 @@
           <excludes>
             <exclude>**/BaseRuntimeTestCase.java</exclude>
           </excludes>
-          <forkMode>pertest</forkMode><!-- normally pertest, if remote debugging
with mvnDebug port 8000, setting in console -DforkMode=none seems to have no effect, set here
-->
+          <forkMode>none</forkMode><!-- normally pertest, if remote debugging
with mvnDebug port 8000, setting in console -DforkMode=none seems to have no effect, set here
-->
           <systemProperties>
             <property>
               <name>torque.configuration.file</name>
@@ -921,7 +921,7 @@
         <torque.test.currentDateDefault /><!-- default="CURRENT_DATE" if database
supports it -->
         <torque.test.currentTimeDefault /><!-- default="CURRENT_TIME" if database
supports it -->
         <torque.test.currentTimestampDefault /><!-- default="CURRENT_TIMESTAMP"
if database supports it -->
-        <torque.driver>com.mysql.cj.jdbc.Driver</torque.driver>
+        <torque.driver>com.mysql.cj.jdbc.Driver</torque.driver><!-- 5.x com.mysql.jdbc.Driver,
8.x: com.mysql.cj.jdbc.Driver -->
         <torque.targetDatabase>mysql</torque.targetDatabase>
         <torque.database.url>jdbc:mysql://localhost:3306/bookstore?serverTimezone=Europe/Berlin&amp;useSSL=false&amp;allowPublicKeyRetrieval=true</torque.database.url>
         <torque.database.user>torque</torque.database.user>

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/DateTimeTimestampTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/DateTimeTimestampTest.java?rev=1869848&r1=1869847&r2=1869848&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/DateTimeTimestampTest.java
(original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/datatypes/DateTimeTimestampTest.java
Fri Nov 15 10:42:21 2019
@@ -322,11 +322,15 @@ public class DateTimeTimestampTest exten
 
         // execute select
         Criteria criteria = new Criteria();
-        // mysql need function time('') or get time
-        criteria.where(DateTimeTimestampTypePeer.TIME_VALUE, new Date(1234000));
+        
+        // java.util.Date cannot be cast to java.sql.Time
+        Date queryTimeValue = new java.sql.Time(new Date(1234000).getTime()); //new Date(1234000);
+        
+        criteria.where(DateTimeTimestampTypePeer.TIME_VALUE, queryTimeValue);
+       
         List<DateTimeTimestampType> result
         = DateTimeTimestampTypePeer.doSelect(criteria);
-
+        
         // verify
         assertEquals(1, result.size());
         assertEquals(dateTimeTimestamp, result.get(0));



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