异常如下
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: java.lang.IllegalArgumentException:
NoticeMap is ambiguous in Result Maps collection (try using the full name including the namespace,
or rename one of the entries)
### Cause: java.lang.IllegalArgumentException:
NoticeMap is ambiguous in Result Maps collection (try using the full name including the namespace,
or rename one of the entries)
原因:mybatis 的 mapper 文件中定义了 相同id 的 resultMap,也可能是不同的mapper文件,比如
A.xml
<mapper namespace="...Dao">
<resultMap id="NoticeMap" type="java.util.Map"/>
B.xml
<mapper namespace="...Dao">
<resultMap id="NoticeMap" type="java.util.Map"/>
id 都是 NoticeMap,所以会报这个错。