abel533 / MyBatis-Spring-Boot

Spring Boot集成MyBatis的基础项目
3.37k stars 1.59k forks source link

通用mapper配 typehandler好像没什么用 #153

Closed ChenYilei2016 closed 5 years ago

ChenYilei2016 commented 5 years ago

properties 中 mybatis.type-handlers-package=xxx

@MappedJdbcTypes({JdbcType.VARCHAR}) @MappedTypes({String.class}) public class MyTypeHandler extends BaseTypeHandler { @Override public void setNonNullParameter(PreparedStatement ps, int i, String parameter, JdbcType jdbcType) throws SQLException { ps.setString(i,"prefix_"+parameter); } 使用mapper 接口的操作没有作用~ 自己加的就优

pengxianggui commented 3 years ago

没结论就关了?