Ibator优化版代码生成过程
1. 下载优化版的ibator,去掉了很多不必要的内容,面对讨厌的注释还是有一些没有用的ibatorgenerator等,做了优化。
2. 编写ibatorConfig.xml
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE ibatorConfiguration PUBLIC "-//Apache Software Foundation//DTD Apache iBATIS Ibator Configuration 1.0//EN" "http://ibatis.apache.org/dtd/ibator-config_1_0.dtd" > <ibatorConfiguration > <classPathEntry location="D:\springworkspace\spider\spider\spider-web\target\spider-web\WEB-INF\lib\mysql-connector-java-5.1.9.jar" /> <ibatorContext id="context1" > <jdbcConnection driverconnectionURL="jdbc:mysql://localhost:3306/gigi" userId="root" password="123456" /> <javaModelGenerator targetPackage="com.isbn.bean" targetProject="kk" /> <sqlMapGenerator targetPackage="com.isbn.app.map" targetProject="kk" /> <daoGenerator targetPackage="com.test.dao" targetProject="kk" type="GENERIC-CI" /> <table schema="gigi" tableName="p_ticker" domainObjectName="Ticker" > </table> </ibatorContext> </ibatorConfiguration>
?3. 新建目录kk
?4. 运行命令:java -jar ibator.jar -configfile ibatorConfig.xml -overwrite >>log.log
输出到日志中。
帖子内容中不能出现"谢谢LZ" 0 0, 囧