1,下载eclipse插件(附件上有)
拷贝插件中features,plugins中的文件到eclipse安装文件夹中的相应文件夹中,重启eclipse即可。
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="G:\eclipseSpace\ssh\WebContent\WEB-INF\lib\ojdbc14.jar" />
<context id="context1" >
<jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver" connectionURL="jdbc:oracle:thin:@127.0.0.1:1521:ORCL" userId="supan" password="root" />
<javaModelGenerator targetPackage="com.supan.model" targetProject="ssh" />
<sqlMapGenerator targetPackage="com.supan.mapper" targetProject="ssh" />
<javaClientGenerator targetPackage="com.supan.client" targetProject="ssh" type="XMLMAPPER" />
<table tableName="TBL_ADDRESS" ></table>
</context>
</generatorConfiguration>
3,加入相关的数据库驱动jar包。
4,右键配置文件,点击生成代码即可。
分享到:
相关推荐
mybatis自动生成代码
myBatis自动生成代码案例
eclipse myeclipse mybatis自动生成代码工具,亲测有效.
用来生成 mybatis mapper,do对象,自动生成代码的工具,
使用SpringBoot下的WebMvc框架(SpringBoot整合thymeleaf,mybatis,druid,mybatis自动生成代码,springbootDemo2付springboot整合Thymeleaf,官方推荐使用Thymeleaf,不建议使用JSP)
通过mybatis将数据库的表自动生成代码和配置文件。
mybatis 自动生成PO,DAO,mapping代码工具。
Mybatis自动生成代码 MBG DefaultShellCallback callback = new DefaultShellCallback(overwrite); //创建 MBG MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings); //执行...
配置好XML后,执行命令就可以直接生成代码
mybatis 自动生成代码文件
mybatis自动生成代码工具,根据单表自动生成mybatis执行所需要的代码(mapper.java,mapper.xml,pojo)
mybatis自动生成代码配置文件,通过配置文件详细讲解以生成各层代码。
mybatis自动生成代码jar包。虽然很想免费共享给大家,但不知道为什么资源分最小是1而不是0了,所以勉强收1分吧。
mybatis自动生成代码的项目,里面有详细的步骤说明,简单易懂,