[jira] [Commented] (TORQUE-375) Support for java.time API

"Graham Leggett (Jira)" <[email protected]> Tue, 23 Jun 2026 17:59:00 +0000 (UTC)
Newsgroups gmane.comp.jakarta.turbine.torque.devel
Message-ID <[email protected]>
    [ https://issues.apache.org/jira/browse/TORQUE-375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18090995#comment-18090995 ] 

Graham Leggett commented on TORQUE-375:
---------------------------------------

Super strange - my tests are all passing for torque-trunk.

In the new JDBC world there is no more special handling for dates, you set the LocalDate (or whatever) with setObject() and getObject().

As a result there are no special cases in the templates.

There is one modification to the dbObjectFieldGetter.vm that detects "getObject" and adds the extra class parameter that is required:

{code}
Index: torque-templates/src/main/resources/org/apache/torque/templates/om/templates/recordmapper/base/dbObjectFieldGetter.vm
===================================================================
--- torque-templates/src/main/resources/org/apache/torque/templates/om/templates/recordmapper/base/dbObjectFieldGetter.vm	(revision 1935209)
+++ torque-templates/src/main/resources/org/apache/torque/templates/om/templates/recordmapper/base/dbObjectFieldGetter.vm	(working copy)
@@ -91,6 +91,8 @@
   #else
     #if ($isEnum == "true")
             ${fieldType} value = ${fieldType}.getByValue(resultSet.${resultSetGetter}(columnIndex));
+    #elseif (${resultSetGetter} == "getObject")
+            ${fieldType} value = resultSet.getObject(columnIndex, ${fieldType}.class);
     #else
             ${fieldType} value = resultSet.${resultSetGetter}(columnIndex);
     #end
{code}

Is there something special I need to do to run the tests over and above "mvn test"?


> Support for java.time API
> -------------------------
>
>                 Key: TORQUE-375
>                 URL: https://issues.apache.org/jira/browse/TORQUE-375
>             Project: Torque
>          Issue Type: Improvement
>    Affects Versions: 7.1
>            Reporter: Graham Leggett
>            Priority: Major
>         Attachments: torque8-javatime1.patch, torque8-javatime2.patch
>
>
> Switch out java.util.Date, replace with the java.time API.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)