MyBatis异常:Error resolving JdbcType

在测试MyBatis中Mapper的时候出现了一个异常:

org.mybatis.spring.MyBatisSystemException: 
nested exception is org.apache.ibatis.builder.BuilderException: 
Error resolving JdbcType. Cause: java.lang.IllegalArgumentException: 
No enum constant org.apache.ibatis.type.JdbcType.Integer

原因是在resultMap中jdbcType写为了Integer,但是在MyBatis中没有这个数据类型,后来查看了原码,发现MyBatis的jdbcType是一个枚举类,有以下类型:

public enum JdbcType {
    ARRAY(2003),
    BIT(-7),
    TINYINT(-6),
    SMALLINT(5),
    INTEGER(4),
    BIGINT(-5),
    FLOAT(6),
    REAL(7),
    DOUBLE(8),
    NUMERIC(2),
    DECIMAL(3),
    CHAR(1),
    VARCHAR(12),
    LONGVARCHAR(-1),
    DATE(91),
    TIME(92),
    TIMESTAMP(93),
    BINARY(-2),
    VARBINARY(-3),
    LONGVARBINARY(-4),
    NULL(0),
    OTHER(1111),
    BLOB(2004),
    CLOB(2005),
    BOOLEAN(16),
    CURSOR(-10),
    UNDEFINED(-2147482648),
    NVARCHAR(-9),
    NCHAR(-15),
    NCLOB(2011),
    STRUCT(2002),
    JAVA_OBJECT(2000),
    DISTINCT(2001),
    REF(2006),
    DATALINK(70),
    ROWID(-8),
    LONGNVARCHAR(-16),
    SQLXML(2009),
    DATETIMEOFFSET(-155);

你可能感兴趣的:(MyBatis异常:Error resolving JdbcType)