public class MyJavaTypeResolverDefaultImpl extends JavaTypeResolverDefaultImpl { public MyJavaTypeResolverDefaultImpl() { super(); //把数据库的 TINYINT 映射成 Integer super.typeMap.put(Types.TINYINT, new org.mybatis.generator.internal.types.JavaTypeResolverDefaultImpl.JdbcTypeInformation("TINYINT", new FullyQualifiedJavaType(Integer.class.getName()))); }}
参考
https://segmentfault.com/a/1190000013037968