javaType和jdbcType、Mybatis引入配置

javaTye与jdbcType

jdbcType报错

nested exception is org.apache.ibatis.builder.BuilderException: Error
parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException:
Error resolving class. Cause: org.apache.ibatis.type.TypeException:
Could not resolve type alias ‘BIGINT’. Cause:
java.lang.ClassNotFoundException: Cannot find class: BIGINT

报错原因:jdbcType写成了javaType
jdbcType是数据库数据类型,javaType是java数据类型;javaType中没用BIGINT类型,BIGINT要大写。

Mybatis引入配置

1.放在resource目录下
mybatis:
  type-aliases-package: com.hmt.cloud.entity
  mapper-locations: classpath:mapper/*.xml
2.放在mapper目录下
mybatis:
  type-aliases-package: com.hmt.cloud.entity
  mapper-locations: classpath:com/hmt/mapper/xml/*.xml

猜你喜欢

转载自blog.csdn.net/qq_41941497/article/details/120484839