ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: How to not verbosely declare resultmaps?
Date Tue, 20 Dec 2005 15:14:04 GMT
I would love to add inline result map support.  :-)

Unfortunately you and I are the minority.  But that doesn't mean we cannot
do it.  So, my question to you is:  how would you like to see the syntax?

Here are some options:

$NAME:VARCHAR$
!NAME:VARCHAR!
@NAME:VARCHAR@
"NAME:VARCHAR"
|NAME:VARCHAR|   << I like the pipes, but does anyone know of any potential
issues with using it?

In hindsight, I wish I had used @@ for inline parameters and ## for inline
result maps (because it looks like a little row set!).

Cheers,
Clinton



On 12/19/05, Yusuf <Yusuf@ekalife.co.id> wrote:
>
> Dear All,
> I've been using ibatis for about 1 year now, and i'm very satisfied with
> it!
> I wanted to ask if i can do this:
>
> <select id="elions.uw.selectInfoProductInsured" resultClass="map">
> SELECT name, age, address, income
>   FROM person
> </select>
>
> but I wanted the default datatype for NAME is String, AGE is
> Integer, and INCOME is Double, not the default BigDecimal..
> without specifying resultMaps or resultClasses (because i have so many
> queries like this and it would be very verbose to declare them one by
> one)
>
> I know we can declare something like this in insert statements like
>
> <insert id="..">
> INSERT INTO person (name, age) VALUES (#name:VARCHAR:-#, #age:NUMBER:0#)
> </insert>
>
> but can it be done in select statements to in ibatis? for example like
> this maybe:
>
> <select id="elions.uw.selectInfoProductInsured" resultClass="map">
> SELECT name:String, age:Integer, address:String, income:Double
>   FROM person
> </select>
>
> Thank you...
>
>

Mime
View raw message