ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sven Boden <list...@pandora.be>
Subject Re: query inside a query
Date Sat, 06 May 2006 08:35:00 GMT
 http://svn.apache.org/repos/asf/ibatis/trunk/java/docs/iBATIS-SqlMaps-2.pdf

;-)

Javier Leyba wrote:

> Thanks for all replys.
>
> Now I want to know where could I found a developers guide. I'm working
> as blind as Stevie Wonder, just using my instinct and experience....
> :)
>
> I couldn't seen a developers guide in ibatis home links !!
>
>
> J
>
>
>
> On 5/6/06, Diran Ayandele <Adediran.Ayandele@sun.com> wrote:
>
>> Javier - you certainly can do this.  Look in the developer's guide under
>> complex properties in result maps.  It's on page 25 in my printed copy.
>>
>> your result map for the main select will have a row like this:
>>
>> <result property="category" column="PRD_CAT_ID" select="getCategory"
>>
>> PRD_CAT_ID refers to the column from the first select you will use as
>> the parameter for the second query.
>> The select parameter refers to the statement name.
>>
>> Hope this is helpful!
>> Diran
>>
>> Javier Leyba wrote:
>>
>> > Hi
>> >
>> > I've a sqlmap to a class that is filled with data from a select but
>> > one field should be getted from another table and then I wonder if is
>> > posible to make the second select in the same sqlmap file and return
>> > data filled.
>> >
>> > My sqlMap is
>> >
>> > -----------
>> > <?xml version="1.0" encoding="UTF-8" ?>
>> > <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"
>> >    "http://www.ibatis.com/dtd/sql-map-2.dtd">
>> >
>> > <sqlMap namespace="Participes">
>> >    <typeAlias alias="participes"
>> >        type="org.jl.meriden.listados.dao.Participes" />
>> >
>> >     <select id="selectParticipes"
>> >       resultClass="participes">
>> >     <![CDATA[
>> >         select
>> >         E10CTA as nroCuenta,
>> >         E10TSU as suscriptas,
>> >         E10TRE as reembolsadas,
>> >         E10TIT as saldoParticipe,
>> >         E10TPG as saldoPignorado,
>> >         E10PSU as saldoSuscripto,
>> >         E10PRE as saldoRembolsado,
>> >         E10PCM as saldoCosteMedio
>> >         from dpicfic.E10PI
>> >         where E01PI.E01FBA <> 0
>> >    ]]>
>> >     </select>
>> >
>> > </sqlMap>
>> > ------------
>> >
>> > and I need to add another field that comes from another select that
>> > receives E10CTA as parameter.
>> >
>> >
>> > Thanks in advance
>> >
>> >
>> > --
>> > Javier Leyba
>> > Barcelona - Spain
>> > http://blog.leyba.com.ar
>>
>>
>
>
> -- 
> Javier Leyba
> Barcelona - Spain
> http://blog.leyba.com.ar
>
>


Mime
View raw message