ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler (JIRA)" <ibatis-...@incubator.apache.org>
Subject [jira] Commented: (IBATIS-297) iBATIS doesn't remap sql fully
Date Thu, 25 May 2006 22:37:30 GMT
    [ http://issues.apache.org/jira/browse/IBATIS-297?page=comments#action_12413311 ] 

Jeff Butler commented on IBATIS-297:

This is by design.  When you use the dollar sign delimiters, iBATIS passes exactly what you
specify.  iBATIS has no provision for re-parsing the statement.  If we really wanted to support
this (we don't), then you could easily invent situations where there were many levels of parsing
before the statement was actually executed.  I think this would be a bad idea - could lead
to very obfuscated code.

In your example, you could make this work the way you want by doing this:

select * from mytable where $condition$ #value#

Then specify map values:

condition: java.lang.String="someField ="
value: java.lang.String="abc"

> iBATIS doesn't remap sql fully
> ------------------------------
>          Key: IBATIS-297
>          URL: http://issues.apache.org/jira/browse/IBATIS-297
>      Project: iBatis for Java
>         Type: Bug

>   Components: SQL Maps
>     Versions: 2.1.5
>     Reporter: adamb

> iBATIS doesn't remap parameters.
> If I have statement with remapResults="true":
> select * from mytable where $dynamicWhereClause$
> and pass in the following two parameters: 
> dynamicWhereClause                              #key#='abc'
> key                                                                 java.lang.String="abc"
> Then the remap puts the #key# in the sql directly, rather than rechecking the statement
to determine what the parameters will be, so gives the error
> message:
> java.sql.SQLException: ORA-00911: invalid character 
> because it hasn't recognised the new hash parameters.
> Version tested on:
> iBATIS 2.1.5

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