We are using
mybatis-spring = 1.1.1
mybatis = 3.1.1
spring = 3.2.0
MapperScannerConfigurer - to scan mappers
How do we reuse resultMap in multiple Mapper xml files?
In this answered question "Reusing MyBatis ResultMap in multiple mapper.xml"
Solution is to use mybatis-config.xml files and add resultMap detail in that file (or import all mapper files in that file).
But we are not using that file and instead using mybatis-spring's MapperScannerConfigurer.
So how can we achieve the same feature with MapperScannerConfigurer?
For example we have a userMapper.xml.
<resultMap id="user" type="com.domain.ModelUser">
<result>..</result>
...
...
</resultMap>
and we need to use this resultMap in for example managerMapper.xml and need to reuse the "user" resultMap.
For example
<select id="getManager" resultMap="com.domain.ModelUser.user">
select .......
</select>
Right now it throws error java.lang.IllegalArgumentException: Result Maps collection does not contain value for com.domain.ModelUser.user
As of now it do not know how and where to find the resultMap in UserMapper.xml file
Any help and direction toward it will be appreciated.
Thank you for you time and help.