ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andre Peterka" <apete...@nsdcom.de>
Subject AW: How to not verbosely declare resultmaps?
Date Tue, 20 Dec 2005 15:51:49 GMT
Hi Clinton,

One issue with the pipes might be the concatenation operator, so you'd have to be careful
when parsing.

Select firstname||lastname as fullname from customer 

Cheers,
Andre

> -----Urspr√ľngliche Nachricht-----
> Von: Jozef Hribik [mailto:jozef.hribik@apsoft.sk] 
> Gesendet: Dienstag, 20. Dezember 2005 16:34
> An: user-java@ibatis.apache.org
> Betreff: Re: How to not verbosely declare resultmaps?
> 
> Hi Clinton,
>  
> +1 abd I would like to have one more option ;-)
> #COLUMN:KEY:TYPE#
> 
> <select id="elions.uw.selectInfoProductInsured" 
> resultClass="map"> SELECT #p.T01_NAME:name:String#, 
> #p.T01_AGE:age:Integer#
>   FROM T01_PERSON p
> </select>
>  
> Cheers
> Jozef
> 
> Clinton Begin wrote:
> 
> >
> > 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 
> > <mailto: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