Eclipse中mybatis自动生成代码
来源:互联网 发布:怎么当淘宝店铺客服 编辑:程序博客网 时间:2024/05/17 21:44
工具下载
- Eclipse中help–>install new software
- 如下图所示
Location:内容 - 完成安装之后,选择新建–Ctrl + N之后,生成generateConfig.xml文件
GenerateConfig.xml文件
- 配置GenerateConfig.xml文件
<?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="C:\Users\baiju\.m2\repository\mysql\mysql-connector-java\5.1.30\mysql-connector-java-5.1.30.jar" /> <context id="context1"> <!-- 去掉生成出来的代码的注解 --> <commentGenerator> <property name="suppressAllComments" value="true" /> <property name="suppressDate" value="true" /> </commentGenerator> <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql:///mybatis" userId="root" password="920512" /> <!-- 生成模型的包名和位置 --> <javaModelGenerator targetPackage="com.future.study.domain" targetProject="future/java"> <property name="enableSubPackages" value="true" /> <property name="trimStrings" value="true" /> </javaModelGenerator> <!-- 生成映射文件的包名和位置 --> <sqlMapGenerator targetPackage="test.mapping" targetProject="future/java"> <property name="enableSubPackages" value="true" /> </sqlMapGenerator> <!-- 生成DAO的包名和位置 --> <javaClientGenerator type="XMLMAPPER" targetPackage="com.future.study.mapper" targetProject="future/java"> <property name="enableSubPackages" value="true" /> </javaClientGenerator> <!-- 要生成哪些表 --> <table tableName="classinfo" domainObjectName="ClassInfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> <table tableName="course" domainObjectName="Course" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> <table tableName="department" domainObjectName="Department" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> <table tableName="namingrecord" domainObjectName="NamingRecord" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> <table tableName="student" domainObjectName="Student" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> <table tableName="supermin" domainObjectName="SuperAdmin" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> <table tableName="teacher" domainObjectName="Teacher" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> <table tableName="teacherclass" domainObjectName="TeacherClass" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> <table tableName="teachercourse" domainObjectName="TeacherCourse" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> </context></generatorConfiguration>
- 在Eclipse中鼠标右键选中 generateConfig.xml文件,选择 Generate Mybatis/iBATIS Artifacts
0 0
- Eclipse中mybatis自动生成代码
- eclipse中 使用mybatis generator自动生成代码 错误
- eclipse使用mybatis generator自动生成代码
- 通过eclipse mybatis generater代码生成插件自动生成代码
- 通过eclipse mybatis generater代码生成插件自动生成代码
- mybatis在eclipse中自动生成
- mybatis中代码自动生成gengrator
- 【java项目实践】在eclipse中使用利用mybatis-generator自动生成Model、Dao、mapping代码
- MyBatis代码自动生成
- mybatis 自动生成代码
- Mybatis自动生成代码
- Mybatis自动生成代码
- MyBatis代码自动生成
- Mybatis 代码自动生成
- MyBatis代码自动生成
- mybatis代码自动生成
- Mybatis代码自动生成
- MyBatis自动生成代码
- JDK高性能编程之容器
- 在Windows Server 2003 r2上安装Tomcat 7
- Velocity笔记
- jsoup 选择器(一)常规选择器
- 写一些计算机/互联网相关词汇
- Eclipse中mybatis自动生成代码
- (java)求power OF num
- bashrc_docker的脚本
- Android官方MVP架构示例项目解析
- zzuli 1872: Which Offer?【水】
- js中json 的增删改操作
- 技术总结
- Java基础--反射、内省
- mysql-proxy安装