欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Ambiguous collection type for property ‘DrugInfos‘. You must specify ‘javaType‘ or ‘resultMap‘.

程序员文章站 2022-07-15 13:09:03
...
 <collection property="DrugInfos" ofType="com.entity.DrugInfo">
            <id property="id" column="rid"/>
            <result property="name" column="name"/>
            <result property="logo" column="logo"/>
            <result property="supplier" column="supplier"/>
            <result property="producttime" column="producttime"/>
            <result property="warrenty" column="warrenty"/>
            <result property="bianhao" column="bianhao"/>
            <result property="price" column="price"/>
            <result property="maijia" column="maijia"/>
            <result property="stock" column="stock"/>

        </collection>

修改xml文件

 <collection property="DrugInfos" ofType="com.entity.DrugInfo" javaType="java.util.List">
            <id property="id" column="rid"/>
            <result property="name" column="name"/>
            <result property="logo" column="logo"/>
            <result property="supplier" column="supplier"/>
            <result property="producttime" column="producttime"/>
            <result property="warrenty" column="warrenty"/>
            <result property="bianhao" column="bianhao"/>
            <result property="price" column="price"/>
            <result property="maijia" column="maijia"/>
            <result property="stock" column="stock"/>

        </collection>

记录一下

相关标签: springboot mybatis