Forgot to say that, of course, there are cons, like in the sample below:

<insert id=”insertUser” parameterType=”User” >
    insert into users (id, username, password)
    values (<parameter name="id"/>, <parameter name="username"/>
<parameter name="password"/>)
</insert>

is much more verbose than:

<insert id=”insertUser” parameterType=”User” >
    insert into users (id, username, password)
    values (#{id}, #{username}, #{password})
</insert>

All the best ;)
Simo

http://people.apache.org/~simonetripodi/



On Wed, Feb 3, 2010 at 9:19 PM, Simone Tripodi <simone.trip...@gmail.com> wrote:
> Hi all,
> just my 2cents: even if I'm familiar with XML SQL maps, I've always
> found the property parameter a little confusing into iBatis, since
> adds a new syntax in the XML syntax, indeed I was a great fan of
> iBatis2 ParameterMap.
> IMHO a "nice to have" in the SQL map is something like:
>
>    <parameter name="department" mode="OUT" jdbcType="CURSOR"
> javaType="Department" resultMap="departmentResultMap"/>
>
> instead of:
>
>    #{department, mode=OUT, jdbcType=CURSOR, javaType=Department,
> resultMap=departmentResultMap}
>
> and the reasons are:
> 1) easier to read, text editors with syntax highlight simplify the
> visualization and no new syntax to learn;
> 2) IDEs that read DTDs could simplify SQLmaps coding, offering 
> code-completion;
> 3) easier to parse, no more \r\n problems.
> What do you think about it?
> All the best,
> Simo
>
> http://people.apache.org/~simonetripodi/
>
>
>
> On Wed, Feb 3, 2010 at 6:16 PM, Marco Speranza
> <marco.speranz...@gmail.com> wrote:
>> Hi Clinton,
>> thanks for your reply, I understand that's a design choice but I sadly
>> noticed that when the property parameter contains a break line character,
>> iBatis raises a so generic error that I had to spend a lot of time to
>> understand what was the cause...
>>
>> So, yesterday I spent a good part of the night studying iBatis code to
>> create a patch that easily (1 line of code) add the support for break line
>> character, with testcases.
>> If you all are open to this suggestion, I'd more than happy to open a Jira
>> issue and attach the patch, please let me know!!!
>>
>> thank
>>
>> 2010/2/2 Clinton Begin <clinton.be...@gmail.com>
>>>
>>> That is by design and will not change.  I suggest that when formatting
>>> parameters, put the entire thing on a newline when necessary.  It's
>>> far too unreadable if you spit them up.
>>>
>>> Clinton
>>>
>>> On 2010-02-02, Marco Speranza <marco.speranz...@gmail.com> wrote:
>>> > Hi all Guys,
>>> >
>>> > we have found a little problem on iBatis3.
>>> > We have create a xml mapper file with this query:
>>> >
>>> >
>>> > <update id="myUpdate" parameterType="MyBean"  flushCache="true">
>>> >
>>> >         UPDATE TAB
>>> >         <set>
>>> >             <if test="id != null"> ID = #{id}, </if>
>>> >             <if test="desc != null"> DESC = #{desc, jdbcType=TIMESTAMP,
>>> > typeHandler=SqlTimestampAsLongTypeHandler}, </if>
>>> >         </set>
>>> >         WHERE
>>> >
>>> >       ...
>>> >
>>> >  </update>
>>> >
>>> >
>>> > where SqlTimestampAsLongTypeHandler is an our type handler.
>>> >
>>> > if there is a TAB character or a NEW LINE character between javaType and
>>> > typeHandler parameter, the type handler is ignored.
>>> >
>>> > thanks all
>>> >
>>> >
>>> >
>>> > --
>>> > Marco Speranza <marco.speranz...@gmail.com>
>>> >
>>>
>>> --
>>> Sent from my mobile device
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org
>>> For additional commands, e-mail: user-java-h...@ibatis.apache.org
>>>
>>
>>
>>
>> --
>> Marco Speranza <marco.speranz...@gmail.com>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org
For additional commands, e-mail: user-java-h...@ibatis.apache.org

Reply via email to