ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "z. zhong (JIRA)" <ibatis-...@incubator.apache.org>
Subject [jira] Created: (IBATIS-282) truncation of date property values in the presence of dynamic sql
Date Mon, 03 Apr 2006 18:14:48 GMT
truncation of date property values in the presence of dynamic sql

         Key: IBATIS-282
         URL: http://issues.apache.org/jira/browse/IBATIS-282
     Project: iBatis for Java
        Type: Bug

  Components: SQL Maps  
    Versions: 2.1.7    
 Environment: linux, mysql, java 1.5
    Reporter: z. zhong

strange interaction between Java.util.Date parameters and dynamic sql.

query 1:
         and rd.event_time       &lt;= #endTime#

the generated SQL is
        and rd.event_time       <= '2006-03-30 18:33:46'
so far so good.

query 2:

just add an extra dynamic sql at the end:

                 and rd.event_time       &lt;= #endTime#
                  <iterate prepend="and" property="done" open=" rd.is_complete in (" conjunction=","
close = ")">#done[]#</iterate>
and the SQL becomes
        and rd.event_time       <= '2006-03-30'
        and ...

The date value has been truncated.

* i've tried other dynamic sql elements: isNotEmpty, etc., and got the same problem.
* insert seems to work.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message