java

使用MyBatis_Generator生成Dto、Dao、Map

2016-11-23  本文已影响0人  cherchao

http://blog.csdn.net/gufeng672/article/details/27196347 使用插件成功
http://blog.csdn.net/wyc_cs/article/details/9023117 成功


Mybatis自动生成Xml文件,针对字段类型为text等会默认产生XXXXWithBlobs的方法问题
默认情况下产生的Mapper.xml里面存在:

需要修改generatorConfiguration.xml,里面的table加属性,如:

[html] view plain copy

在CODE上查看代码片在CODE上查看代码片 派生到我的代码片派生到我的代码片

<table domainObjectName="User" tableName="test_user">
<columnOverride column="address" javaType="java.lang.String" jdbcType="VARCHAR" />
</table>

备注:MySQL表里面的Address字段是text类型的,这样处理产生的Xml文件自动会把这个字段转换为VARCHAR;

上一篇 下一篇

猜你喜欢

热点阅读