写在前面.
每次给sqlite db 中的表生成model时都要折腾半天 mybatis generator.这东西唯一的好处就是大表不用写很长的java bean.现在备份一份完整可用的.以后都按照这份配置就好了.
配置文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"> <generatorConfiguration> <classPathEntry location="L:\jar\sqlite-jdbc-3.7.2.jar"></classPathEntry> <context id="context1"> <!-- 不需要注释 --> <commentGenerator> <property name="suppressAllComments" value="true" /> </commentGenerator> <jdbcConnection driverClass="org.sqlite.JDBC" connectionURL="jdbc:sqlite:K:\dbName.db" userId="" password=""> </jdbcConnection> <javaModelGenerator targetPackage="model" targetProject="myBatisGen2"></javaModelGenerator> <sqlMapGenerator targetPackage="model" targetProject="myBatisGen2"></sqlMapGenerator> <javaClientGenerator targetPackage="model" targetProject="myBatisGen2" type="XMLMAPPER"></javaClientGenerator> <table tableName="puzzle"> </table> </context> </generatorConfiguration>
|
只要以后照着这份配置应该就没什么问题了.