mybatis****(maven)-Eclipse
。
上面是****的一些项目路径
1.maven添加plugin
- <!-- mybatis ****maven工具 -->
- <plugin>
- <groupId>org.mybatis.generator</groupId>
- <artifactId>mybatis-generator-maven-plugin</artifactId>
- <version>1.3.2</version>
- <dependencies>
- <dependency>
- <groupId>mysql</groupId>
- <artifactId>mysql-connector-java</artifactId>
- <version>${mysql.version}</version>
- </dependency>
- </dependencies>
- <configuration>
- <!--配置文件的路径-->
- <configurationFile>${basedir}/src/main/resources/generatorConfig.xml</configurationFile>
- <overwrite>true</overwrite>
- </configuration>
- </plugin>
2.添加jar包
- <!-- mybatis****jar包 -->
- <dependency>
- <groupId>org.mybatis.generator</groupId>
- <artifactId>mybatis-generator-core</artifactId>
- <version>1.3.2</version>
- </dependency>
- 3.在resources目录下添加配置文件
- <pre name="code" class="html"><?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>
- <context id="test" targetRuntime="MyBatis3">
- <!-- 一些工具 -->
- <plugin type="org.mybatis.generator.plugins.EqualsHashCodePlugin"></plugin>
- <plugin type="org.mybatis.generator.plugins.SerializablePlugin"></plugin>
- <plugin type="org.mybatis.generator.plugins.ToStringPlugin"></plugin>
- <commentGenerator>
- <!-- 插入一个日期字段 -->
- <property name="suppressDate" value="true" />
- <!-- 注释 -->
- <property name="suppressAllComments" value="false" />
- </commentGenerator>
- <!--数据库链接 参数 -->
- <jdbcConnection driverClass="com.mysql.jdbc.Driver"
- connectionURL="jdbc:mysql://localhost:3306/meedesk" userId="root"
- password="moshaoming">
- </jdbcConnection>
- <javaTypeResolver>
- <!-- This property is used to specify whether MyBatis Generator should
- force the use of java.math.BigDecimal for DECIMAL and NUMERIC fields, -->
- <property name="forceBigDecimals" value="false" />
- </javaTypeResolver>
- <!-- 生成模型的包名和位置 -->
- <javaModelGenerator targetPackage="com.pts.meedesk.model"
- targetProject="src/main/java">
- <property name="enableSubPackages" value="true" />
- <property name="trimStrings" value="true" />
- </javaModelGenerator>
- <!-- 生成映射文件的包名和位置 -->
- <sqlMapGenerator targetPackage="com.pts.meedesk.mappers"
- targetProject="src/main/resources">
- <property name="enableSubPackages" value="true" />
- </sqlMapGenerator>
- <!-- 生成DAO的包名和位置 -->
- <javaClientGenerator type="XMLMAPPER"
- targetPackage="com.pts.meedesk.dao" targetProject="src/main/java">
- <property name="enableSubPackages" value="true" />
- </javaClientGenerator>
- <!-- 要生成哪些表 -->
- <table tableName="User" domainObjectName="User"
- enableCountByExample="false" enableUpdateByExample="false"
- enableDeleteByExample="false" enableSelectByExample="false"
- selectByExampleQueryId="false"></table>
- </context>
- </generatorConfiguration></pre><br>
- 4.Run as->maven bulid->mybatis-generator:generate 执行 ->F5 刷新<br>
- <br>
- <pre></pre>
- <br>
- <br>
相关推荐
- hadoop+win10+Eclipse环境导包注意事项
- 使用eclipse写项目时,并使用maven导包后,查看不了源码
- IDEA 2020 创建Maven项目
- testng使用时,需要先将插件引入到Eclipse里才能使用,maven只是自动引入了包
- Maven 虐我千百遍,我待 Maven 如初恋
- Mac 修改maven 配置
- 在eclipse中安装properties插件PropertiesEditor及设置(附图),ASCII码转换成中文
- eclipse中propreties运行结果乱码问题(未解决)
- 在eclipse中安装properties插件PropertiesEditor及设置(附图),ASCII码转换成中文
- 使用Xtext为Eclipse和IntelliJ开发DSL
- 1.11 Xcode右侧界面介绍 [原创iOS开发-Xcode教程]
- 查看进程的启动目录