标签:public 自动 encoding oct main jar ble 中文注释 string
第一步:先下载jar包,mybatis-generator-core-1.3.2.jar, mysql-connector-java-5.1.13.jar;<generatorConfiguration>
<classPathEntry
location="F:/mybatis/mysql-connector-java-5.1.13.jar"/>
<context id="my" targetRuntime="MyBatis3">
<commentGenerator>
<property name="suppressDate" value="false"/>
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://182.254.128.241:4780/product_wms_test" userId="cdb_outerroot"
password="zaq1CDE#"/>
<javaModelGenerator targetPackage="cn.eeka.productwms.entity.biz"
targetProject="F:/mybatis/wms/entity">
<property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<sqlMapGenerator targetPackage="mappers"
targetProject="F:/mybatis/wms/mapper">
<property name="enableSubPackages" value="true"/>
</sqlMapGenerator>
<javaClientGenerator targetPackage="cn.eeka.productwms.dao.biz"
targetProject="F:/mybatis/wms/dao" type="XMLMAPPER">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<table tableName="PM_ProductInBound" domainObjectName="ProductInBound"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
<table tableName="PM_ProductInBoundDetail" domainObjectName="ProductInBoundDetail"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
</context>
</generatorConfiguration>
第三步: 执行命令
打开命令窗口,切换到mybatis所在包的路径下面,输入命令: java -jar mybatis-generator-core-1.3.2.jar -configfile generatorConfig.xml -overwrite
或者 直接双击".bat"文件
注意: xml里面涉及到的一些路径配置,需要根据自己的实际情况填写正确,
如果执行后出现报错,一般有两种原因:
a.把xml中的中文注释都去掉;
b.把xml的编码格式转换成UTF-8 无BOM格式的;
标签:public 自动 encoding oct main jar ble 中文注释 string
原文地址:http://blog.51cto.com/9381188/2068494