1,下载mybatis-generator-core-1.3.2.jar
2,添加配置文件
<?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="E:\Health\Web\lib\ojdbc14.jar" /> <context id="context1"> <jdbcConnection connectionURL="jdbc:oracle:thin:@ip:orcl" driverClass="oracle.jdbc.driver.OracleDriver" userId="**" password="**" /> <javaModelGenerator targetPackage="com.bf.health.entity" targetProject="E:\Health\Web\src\main\java" /> <sqlMapGenerator targetPackage="com.bf.health.entity.xml" targetProject="E:\Health\Web\src\main\java" /> <javaClientGenerator targetPackage="com.bf.mapper" targetProject="E:\Health\Web\src\main\java" type="XMLMAPPER" /> <table tableName="product"> </table> </context> </generatorConfiguration>
3,运行命令
java -jar lib\mybatis-generator-core-1.3.2.jar -configfile generatorConfig.xml -overwrite
时间: 2024-10-25 22:25:50