`
Donald_Draper
  • 浏览: 972383 次
社区版块
存档分类
最新评论

Myeclispe下mybatis generator的使用

阅读更多
准备:下载附件包解压到myeclispe的dropins文件夹下
选择项目
1.新建config文件


配置路径




2.配置config
<?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:\lib\mysql-connector-5.1.8.jar" />
	  <context id="contextMybatis" >
	  		<!--数据库链接地址账号密码-->
		    <jdbcConnection driverClass="com.mysql.jdbc.Driver" 
		    	connectionURL="jdbc:mysql://192.168.126.128:3306/test?useUnicode=true&amp;characterEncoding=UTF-8" 
		    	userId="test" 
		    	password="test" />
		     <!--生成Model类存放位置-->
		    <javaModelGenerator targetPackage="Model" targetProject="Mybatis" />
		    <!--生成映射文件存放位置-->
		    <sqlMapGenerator targetPackage="Mapper" targetProject="Mybatis" />
		    <!--生成Dao类存放位置-->
		    <javaClientGenerator targetPackage="Dao" targetProject="Mybatis" type="XMLMAPPER" />
		    <!--生成对应表及类名-->
		    <table tableName="user"  
            domainObjectName="user" enableInsert="true"  
            enableSelectByPrimaryKey="true" enableUpdateByPrimaryKey="true"  
            enableDeleteByPrimaryKey="true" enableSelectByExample="false"  
            enableDeleteByExample="false" enableCountByExample="false"  
            enableUpdateByExample="false">  
        	</table>  
        	<table tableName="role"  
            domainObjectName="role" enableInsert="true"  
            enableSelectByPrimaryKey="true" enableUpdateByPrimaryKey="true"  
            enableDeleteByPrimaryKey="true" enableSelectByExample="false"  
            enableDeleteByExample="false" enableCountByExample="false"  
            enableUpdateByExample="false">  
        	</table>  
  	 </context>
</generatorConfiguration>

3.右击配置文件,点击下图矩形框选项即可


  • 大小: 24.2 KB
  • 大小: 13.6 KB
  • 大小: 65.6 KB
分享到:
评论

相关推荐

    Myeclipse8~10安装mybatis-generator,带使用步骤

    在Myeclipse8~10版本里本人亲测可用,并写了详细的使用说明,基本小白级别的也可以轻轻松松上手,3分钟完成安装使用。 附件里包含了所有需要的文件,具体使用使用步骤说明文档 我走了很多弯路,只为了让你少走点弯路

    myeclipse-mybatis-generator插件

    使用MyEclipse MyBatis Generator插件时,需要配置MyBatis Generator的XML配置文件,指定数据库连接信息、表名等参数。配置完成后,通过插件生成的代码可以直接导入项目,快速构建数据访问层。此外,插件还支持...

    myeclipse mybatis-generator 插件

    标题中的"myeclipse mybatis-generator 插件"指的是在MyEclipse中使用的MyBatis Generator插件。这个插件允许开发者通过简单的配置,自动生成与数据库交互的Java代码,包括Mapper接口、Mapper XML文件、实体类和DAO...

    mybatis generator Myeclipse插件

    文件名"mybatisgenerator_myeclipse10-sql-oracle"可能表示这是一个适用于Myeclipse 10版本的Mybatis Generator插件,并且重点支持Oracle数据库的配置和使用。"sql"可能代表SQL数据库的通用性,而"oracle"则强调了对...

    mybatis generator eclipse插件的安装

    下面我们将详细介绍如何在Eclipse中安装和使用MyBatis Generator插件。 首先,我们需要获取MBG的插件文件。通常,你可以从官方网站或者第三方资源站点下载到`mybatis-generator-eclipse-plugin`的zip压缩包。下载...

    mybatis-generator-1.3.5 Myeclipse 插件

    mybatis-generator-1.3.5 Myeclipse 插件 mybatis-generator-1.3.5 Myeclipse 插件mybatis-generator-1.3.5 Myeclipse 插件

    mybatis generator for myeclipse10

    1. 首先,你需要下载 MBG 的 `.zip` 文件,如附件中的 `mybatisgenerator.zip`。 2. 解压下载的文件,找到其中的 `.jar` 文件,这些是 MBG 插件的核心组件。 3. 在 MyEclipse 中,选择“Window” -&gt; “Preferences”...

    mybatisGeneratorEclipse1.3.4-1.3.7.rar

    MyEclipse下安装MyBatis Generator代码反向生成工具。唉,大家为什么都把积分定那么高呢?MyBatis Generator这个本来就是可以下载的。本来想不要积分,但是我也没有了,定少一点吧。打包的是1.3.4到1.3.7共4版本。...

    MyBatis_Generator_1.3.3

    改变了注解提供Generator使用新的SQL生成器类从MyBatis的3.2。如果你必须在一个旧版本的MyBatis运行,设置在配置属性“useLegacyBuilder”为“true”。 问题#11日 - Maven插件现在记录到日志行家(感谢保罗克劳斯)...

    Myeclipse8~10安装mybatis-generator插件

    下面将详细介绍如何在Myeclipse 8到10版本中安装并使用Mybatis Generator插件。 首先,了解Mybatis Generator的基本概念是必要的。Mybatis Generator基于XML配置文件,通过读取数据库表信息,可以自动生成与数据库...

    myeclipse插件生成mybatis底层增删改代码

    在MyEclipse中使用MyBatis Generator插件,首先需要安装该插件。安装过程通常包括在MyEclipse的插件市场中搜索MyBatis Generator,然后按照提示进行下载和安装。安装完成后,我们需要配置插件的配置文件...

    MyEclipse MyBatis Generatorl离线安装包

    这个安装包适用于MyEclipse 2014版本,确保用户在没有网络连接的情况下也能方便地安装和使用MyBatis Generator。 MyBatis Generator是一个强大的自动化工具,它可以自动生成MyBatis框架所需的SQL映射文件、Java模型...

    eclipse MyBatis Generator 1.3.2 离线安装包

    在使用Eclipse MyBatis Generator 1.3.2之前,你需要确保已经安装了Eclipse或MyEclipse集成开发环境。接下来,我们将离线安装MBG插件: 1. 下载并解压“MyBatis Generator 1.3.2”压缩包,里面通常包含`eclipse-...

    myeclipse Mybatis自动生成

    下面将详细介绍如何在Myeclipse中使用Mybatis Generator。 首先,我们需要确保已经安装了Mybatis Generator插件。如果没有,可以在Myeclipse的插件市场中搜索并安装。安装完成后,我们可以在项目的源代码目录下创建...

    MyEclipse2018中安装Mybatis generator插件的实现步骤

    在本教程中,我们将详细介绍如何在MyEclipse 2018中安装并使用Mybatis Generator插件。 首先,我们遇到了一个常见问题:在使用Maven配置Mybatis Generator时,由于与Eclipse版本不兼容,导致插件无法正常工作。为了...

    myeclipse手动安装mybatis插件安装包

    2. **创建工作空间目录**:在MyEclipse的工作空间内,新建一个目录,例如命名为"MyPlugins",并将下载的"MyBatisGenerator.jar"文件放入该目录。 3. **配置MyEclipse插件路径**:打开MyEclipse,选择“Window”菜单...

    mybatis generator 插件

    MyBatis Generator(MBG)是一款强大的自动化代码生成工具,尤其在使用MyBatis作为持久层框架时,它能够极大地提高开发效率。MBG能够自动生成Java实体类、Mapper接口和XML映射文件,以及相应的DAO层代码,从而减少了...

    利用MyBatis Generator自动创建代码

    安装完成后,可以通过MyEclipse的“New -&gt; MyBatis Generator”菜单启动MBG,选择配置文件并运行,生成的代码会自动导入到项目中。 MBG支持多种自定义选项,比如是否生成example类(用于动态SQL),是否生成...

    支持mysql物理分页的 MyBatis Generator 1.3.2

    myeclipse 2013 插件MyBatis Generator 1.3.2生成的代码缺少分页,使用麻烦。修改了源码org.mybatis.generator.core_1.3.2.201207161521.jar包,增加了PaginationPlugin和SelectOneByExamplePlugin两个扩展插件。...

    mybatis generator插件的手动安装即使用

    - 在MyEclipse中,右键点击配置文件,选择"Run As" -&gt; "MyBatis Generator",MBG会根据配置文件自动生成相应的代码。 7. **使用生成的代码**: - 生成的代码包括实体类(Entity)、Mapper接口(Mapper Interface...

Global site tag (gtag.js) - Google Analytics