How to retrieve multiple tables from stored procedure in mybatis?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to retrieve multiple tables from stored procedure in mybatis?

hantaeil
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Hi, I'm a new recruits in java developer company.
I'm developing some web site in Spring Framework + myBatis + MySql, but I have some problem.
Now, I'm writing a mapper(SQL) XML. Already, I written a stored procedure. I want to retrieve multiple tables(result sets:more than one table) from one request.
I can retrieve one table(result)..but I can't retrieve multiple result.



This is xml code.
<resultMap id="bCodeResult" type="com.neoplus.admin.vo.BCodeVo">
    ....
</resultMap>

<resultMap id="bmCodeResult" type="com.neoplus.admin.vo.BMCodeVo">
    ....
</resultMap>

<select id="selectEmployeeItem" parameterType="HashMap"
    resultMap="bCodeResult, bmCodeResult" statementType="CALLABLE">
    { call SP_CODELIST_GET(
        #{sessionid, mode=IN, jdbcType=VARCHAR}
     )
    }
</select>

I saw "You can try resultMap='x, z'" in any web site. So I tried that, but I retrieved first result.

So.. I need your help.

Thanks and sorry for my bad English.