ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brandon Goodin <brandon.goo...@gmail.com>
Subject Re: Reading from different datasources in same SqlMapClient instance
Date Tue, 15 Feb 2005 15:45:53 GMT
There is no way to accomplish this with the resultmap. You could
simply get your list with the select and then iterate over it and
populate the complex property (mold) by calling getMoldById statement.

Brandon


On Tue, 15 Feb 2005 08:36:50 -0500, Akins, Greg <gakins@amervideo.com> wrote:
> Maybe I didn't express myself well enough in my last post.
> 
> I have a SqlMap that has a select attribute on the result, so that the
> Collection is read from another statement.
> 
> What I'd really like to be able to do, is use a Java class (instead of a
> sql statement), so I can get the collection from another datasource.
> 
> Is there a way to force Ibatis to execute a Java method to populate a
> result set, instead of just using the SqlMaps?
> 
> <resultMap id="getWareResult" class="ware" >
> <result property="id" column="WareId" />
> <result property="laserId" column="LaserId" />
> <result property="mold" column="mold_id" select="getMoldById" />
> <result property="avpId" column="AvpId" />
> </resultMap>
> <statement id="getWares" resultMap="getWareResult" >
> select WareId, LaserId, MoldId, AvpId
> from Ware
> where AvpId = #id#
> </statement>
> 
> Greg Akins
> Software Engineer
> Sony Electronics, STP Systems
> 724.696.7322 (Sony)
> 724.696.6147 (AV)
> 724.454.7790 (Cell)
> 412.590.3973 (Pager)
>

Mime
View raw message