2、mapper.xml将jdbcType写错为javaType

错误的写法:

<resultMap id="BaseResultMap" type="com.dong.springcloud.entities.Payment">
        <id column="id" property="id" ></id>
        <id column="serial" property="serial" javaType="VARCHAR"/> 
    </resultMap>

 

 

报错:Could not resolve type alias 'VARCHAR'. Cause: java.lang.ClassNotFoundException: Cannot find class: VARCHAR

javaType中没有VARCHAR,只有数据库里面才有

因为那里写错了,会导致所有的注解不生效:

 

 

正确的写法:

<resultMap id="BaseResultMap" type="com.dong.springcloud.entities.Payment">
        <id column="id" property="id" ></id>
        <id column="serial" property="serial" jdbcType="VARCHAR"/>
    </resultMap>

 

 

posted @ 2020-07-31 13:53  JDLiao  阅读(541)  评论(0编辑  收藏  举报