mybatis-generator下载地址:
下载好后,解压:
D:\tools\mybatis-generator-core-1.3.2\lib>dir 驱动器 D 中的卷没有标签。 卷的序列号是 000B-8134 D:\tools\mybatis-generator-core-1.3.2\lib 的目录2015/10/28 14:37.2015/10/28 14:37 ..2015/10/28 14:38 2,039 generatorConfig.xml2012/07/16 14:53 1,696,539 mybatis-generator-core-1.3.2-javadoc.jar2012/07/16 14:53 411,564 mybatis-generator-core-1.3.2-sources.jar2012/07/16 14:54 516,357 mybatis-generator-core-1.3.2.jar2014/04/09 09:17 709,922 mysql-connector-5.1.7.jar2015/10/28 14:39 src 5 个文件 3,336,421 字节 3 个目录 249,392,951,296 可用字节
编辑好generatorConfig.xml,在其中配置数据库的元信息以及生成代码相关信息:
执行如下命令:
D:\tools\mybatis-generator-core-1.3.2\lib>Table configuration with catalog null, schema null, and table user did not resolve to any tablesMyBatis Generator finished successfully, there were warnings.D:\tools\mybatis-generator-core-1.3.2\lib>dir
执行完毕后,得到如下的代码生成目录: