代码拉取完成,页面将自动刷新
<?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="mysql-connector-java-8.0.13.jar"/>-->
<!--如果你希望不生成和Example查询有关的内容,那么可以按照如下进行配置:-->
<context id="Mysql" targetRuntime="mybatis.generator.enhance.IntrospectedTableEnhanceImpl" defaultModelType="flat">
<commentGenerator>
<property name="suppressDate" value="true"/>
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<!--数据库链接地址账号密码-->
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/bbs?useSSL=false&serverTimezone=GMT&useUnivalue=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false"
userId="root"
password="RoOtPaSs">
</jdbcConnection>
<javaTypeResolver>
<property name="forceBigDecimals" value="false"/>
</javaTypeResolver>
<!--生成Model类存放位置-->
<javaModelGenerator targetPackage="bbs.api.biz.model.entity" targetProject="bbs-api-biz/bbs-api-biz-model/src/main/java/">
<property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<!--生成映射文件存放位置-->
<sqlMapGenerator targetPackage="bbs.api.biz.dal.mapper.xml.original" targetProject="bbs-api-biz/bbs-api-biz-dal/src/main/java/">
<property name="enableSubPackages" value="true"/>
</sqlMapGenerator>
<!--生成Dao类存放位置
http://blog.csdn.net/qq_27376871/article/details/51360638
MyBatis3:
ANNOTATEDMAPPER: 基于注解的Mapper接口,不会有对应的XML映射文件
MIXEDMAPPER: XML和注解的混合形式,上面这种情况中的SqlProvider注解方法会被XML替代。
XMLMAPPER: 所有的方法都在XML中,接口调用依赖XML文件。会生成一个XXX.xml文件内有各种sql语句,是mapper的实现。
MyBatis3Simple:
ANNOTATEDMAPPER: 基于注解的Mapper接口,不会有对应的XML映射文件
XMLMAPPER: 所有的方法都在XML中,接口调用依赖XML文件。
-->
<javaClientGenerator type="XMLMAPPER" targetPackage="bbs.api.biz.dal.mapper.original" targetProject="bbs-api-biz/bbs-api-biz-dal/src/main/java/">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<!--生成对应表及类名-->
<table tableName="bbs_comment" domainObjectName="Comment"><generatedKey identity="true" type="post" column="comment_id" sqlStatement="Mysql"/></table>
<table tableName="bbs_post" domainObjectName="Post"><generatedKey identity="true" type="post" column="post_id" sqlStatement="Mysql"/></table>
<table tableName="bbs_user" domainObjectName="User"><generatedKey identity="true" type="post" column="user_id" sqlStatement="Mysql"/></table>
<table tableName="bbs_user_star_and_praise_map" domainObjectName="UserStarAndPraiseMap"><generatedKey identity="true" type="post" column="user_SAPM_id" sqlStatement="Mysql"/></table>
</context>
</generatorConfiguration>
<!--
# 注意:*Mapper.xml 文件,每次重新生成都需要先删除,否则部分内容会重复生成,导致错误,版本1.3.5以及现在最新版1.3.7均有此问题。
# 执行之前请确保文件路径是正确的。
# 以下三行执行删除生成的所有文件
del/f/s/q C:\workspace\spring-boot-bbs-api\bbs-api-biz\bbs-api-biz-dal\src\main\java\bbs\api\biz\dal\mapper\original\*.*
del/f/s/q C:\workspace\spring-boot-bbs-api\bbs-api-biz\bbs-api-biz-model\src\main\java\bbs\api\biz\model\entity\*.*
del/f/s/q C:\workspace\spring-boot-bbs-api\bbs-api-biz\bbs-api-biz-dal\src\main\java\bbs\api\biz\dal\mapper\xml\original\*.xml
# 以下语句生成 mapper,分别针对 MySQL 的两个版本,执行时请注意 MySQL 的 driverClass 值。
# 针对 MySQL v8.x,执行前,请确保本文件中 driverClass 的值为:com.mysql.cj.jdbc.Driver
java -Dfile.encoding=UTF-8 -cp mybatis-generator-1.3.7.jar;mybatis-generator-enhance-mysql-v8.x.jar org.mybatis.generator.api.ShellRunner -configfile generatorConfig.xml -overwrite
# 针对 MySQL v5.7.x(理论上,v5.7 以前的版本也是支持的,没测试),执行前,请确保本文件中 driverClass 的值为:com.mysql.jdbc.Driver
java -Dfile.encoding=UTF-8 -cp mybatis-generator-1.3.7.jar;mybatis-generator-enhance-mysql-v5.7.x.jar org.mybatis.generator.api.ShellRunner -configfile generatorConfig.xml -overwrite
-->
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。