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>

 

原文地址:https://www.cnblogs.com/-jiandong/p/13409290.html