mybatis-plus的generator配置

下载myBatisX插件,用mapper和xml方法的跳转
在这里插入图片描述

在这里插入图片描述

<!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="mysql" targetRuntime="MyBatis3">
		<!-- 自动识别数据库关键字,默认false,如果设置为true,根据SqlReservedWords中定义的关键字列表; 一般保留默认值,遇到数据库关键字(Java关键字),使用columnOverride覆盖 -->
		<property name="autoDelimitKeywords" value="true" />
		<property name="javaFileEncoding" value="UTF-8" />
		<property name="javaFormatter"
			value="org.mybatis.generator.api.dom.DefaultJavaFormatter" />
		<property name="xmlFormatter"
			value="org.mybatis.generator.api.dom.DefaultXmlFormatter" />
		<property name="beginningDelimiter" value="`" />
		<property name="endingDelimiter" value="`" />

		<plugin type="org.mybatis.generator.plugins.SerializablePlugin"></plugin>
		<!-- Pagination -->
		<plugin type="org.mybatis.generator.plugin.ext.impl.MysqlPaginationPlugin"></plugin>
<!--		<plugin type="org.mybatis.generator.plugin.ext.impl.EntityNullPlugin"></plugin>-->

		<commentGenerator
			type="org.mybatis.generator.plugin.ext.impl.CommentExtGenerator">
			<property name="suppressAllComments" value="false" />
			<property name="javaFileEncoding" value="UTF-8" />
			<property name="suppressDate" value="false" />
			<property name="addRemarkComments" value="true" />
		</commentGenerator>

		<jdbcConnection driverClass="com.mysql.jdbc.Driver"
			connectionURL="jdbc:mysql://host:post/数据库名?characterEncoding=utf8"
			userId="用户名" password="用户密码">
			<property name="useInformationSchema" value="true" />
			<property name="remarksReporting" value="true" />
			<property name="nullCatalogMeansCurrent" value="true"/>
		</jdbcConnection>


		<!-- java类型处理器 用于处理DB中的类型到Java中的类型,默认使用JavaTypeResolverDefaultImpl; 注意一点,默认会先尝试使用Integer,Long,Short等来对应DECIMAL和
			NUMERIC数据类型; -->
		<javaTypeResolver
			type="org.mybatis.generator.internal.types.JavaTypeResolverDefaultImpl">
			<property name="forceBigDecimals" value="false" />
		</javaTypeResolver>

		<javaModelGenerator targetPackage="com.kxt.springboot.db.entity"
			targetProject="src/main/java">
			<property name="enableSubPackages" value="true" />
			<property name="trimStrings" value="true" />
		</javaModelGenerator>

		<sqlMapGenerator targetPackage="mapper" targetProject="src/main/resources">
			<property name="enableSubPackages" value="true" />
		</sqlMapGenerator>

		<javaClientGenerator type="XMLMAPPER"
			targetPackage="com.kxt.springboot.db.repository"
			targetProject="src/main/java">
			<property name="enableSubPackages" value="true" />
		</javaClientGenerator>



		<table tableName="表名" domainObjectName="生成的名称"

			   enableCountByExample="false" enableUpdateByExample="false"
			   enableDeleteByExample="false" enableSelectByExample="false"
			   selectByExampleQueryId="false">
		</table>

	</context>

</generatorConfiguration>

 			<plugin>
                <groupId>org.mybatis.generator</groupId>
                <artifactId>mybatis-generator-maven-plugin</artifactId>
                <version>1.3.2</version>
                <configuration>
                    <verbose>true</verbose>
                    <overwrite>true</overwrite>
                </configuration>
            </plugin>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值