ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: [iBATIS3] SQL Parsing Question
Date Tue, 02 Jun 2009 21:20:49 GMT
That was a challenge i had... Unfortunately, it will be parsed at statement
execution time as a string replacement, not at map build time with the
passed in properties.  It's an inconsistency... :-/
In Statements:
    #{}  == Prepared Statement Parameter
    ${}  == String replacement at execution time for statements

In Element Attributes:
    <node attr="${value}"> will be replaced at map build time, using the
properties as values...

To separate the concepts, we'd have to introduce another token, perhaps
    ${}  == Replaced at map build time, using the properties as values
(consistent with element/attribute)
    #{}  == Prepared Statement Parameter
    @{} == String replacement at execution time for statements

It might not be hard to change that, I think it's in one place in the code.

Clinton

On Tue, Jun 2, 2009 at 1:22 PM, Jeff Butler <jeffgbutler@gmail.com> wrote:

> Hi Clinton,
>
> Sorry to ask without trying it, call me lazy...
>
> Can we do something like this:
>
> #{myProperty,typeHandler=${myTypeHandler}}
>
> In other words, does the string replacement parse run before the parameter
> parse?
>
> This would simplify things for Ibator, but is also similar to an open
> request with iBATIS 2 - http://issues.apache.org/jira/browse/IBATIS-599
>
>
> Thanks!
> Jeff Butler
>
>

Mime
View raw message