i tried the following mapping:
<select id="getRequestDetail" statementType="CALLABLE" parameterType="test.domain.RequestDetailRequest" resultMap="ExternalManagersMap, SubjectServicesMap">
{call pop.dbo.getRequestDetail ( #{uid, mode=IN, jdbcType=VARCHAR},
#{requestId, mode=IN, jdbcType=INTEGER},
#{resultStatus, mode=OUT, jdbcType=INTEGER},
#{resultMsg, mode=OUT, jdbcType=VARCHAR} )}
</select>
<resultMap type='test.domain.User' id="ExternalManagersMap">
<result property="name" column="externalManager"/>
</resultMap>
<resultMap type='test.domain.Service' id="SubjectServicesMap">
<result property="name" column="serviceName"/>
<result property="id" column="serviceId"/>
</resultMap>
But I have error:
org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 2
My interface is:
Map<String, Object> getRequestDetail(RequestDetailRequest detailRequest);
Can you please help me howto map multiple resutlset with calling procedure? My DB is Sybase.
sqlSession.selectOne indicates you are only expecting one row returned from the procedure.
Instead you should use sqlSession.select