MyBatis multiple resultsets

后端 未结 1 1042
伪装坚强ぢ
伪装坚强ぢ 2020-12-20 00:45

I am currently migrating code from iBatis 2 to MyBatis 3. I have a function that returns multiple results sets which we map to different classes. In iBatis we where able t

相关标签:
1条回答
  • 2020-12-20 01:06

    Using a resultMap with a comma separated list of result maps fixes this issue.

    <resultMap id="adminCashBalance" type="AdminCashBalance">
    ...
    </resultMap>
    
    <resultMap id="adminCashMovement" type="AdminCashMovement">
    ...
    </resultMap>
    
    <resultMap id="adminCashTrx" type="AdminCashTrx">
    ...
    </resultMap>
    
    <select id="findCashItems" parameterType="map" resultMap="adminCashBalance, adminCashMovement, adminCashTrx">
        exec RequestActualAdministrativeData #{portfolioId}
    </select>
    
    0 讨论(0)
提交回复
热议问题