You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Shan Syed <sh...@gmail.com> on 2007/07/27 01:03:21 UTC

Passing parameter objects to sub-selects?

I have a function, like so:

    <select id="loadActivity" resultMap="activityResult">
        <include refid="selectActivity_fragment"/>
        where activity_id = #activityID#;
    </select>

the ResultMap is like so:

    <resultMap id="activityResult" class="ActivityVO" groupBy="activityID" >
        <result property="activityID" column="activity_id"/>
        <result property="name" column="activity_name"/>
        <result property="picture" column="picture" />
        <result property="parameters" column="activity_family_id"
select="loadParametersByActivityFamily"/>
      </resultMap>

which, as you see, makes a subselect itself.

The first select takes a java Map as a param class, in which various values
are stored. Is there a way to make this Map available to the sub-select?
I know I can make multiple columns available to it in the ResultMap, via
syntax like:
<result property="blah" column="{val1=col1, val2=col2}" select="getBlah"/>

But is there a way to pass in the parameter class, instead of the column
result?