1
0
mirror of https://gitee.com/bookshelfplus/bookshelfplus synced 2025-09-13 20:21:38 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
Files
bookshelfplus/bookshelfplus/src/main/resources/mybatis-generator.xml

113 lines
7.0 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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>
<!--
配置详解
refer: https://www.cnblogs.com/throwable/p/12046848.html
-->
<!-- 引入外部properties文件 https://www.cnblogs.com/zjulanjian/p/10972960.html -->
<properties resource="application.properties"/>
<context id="DB2Tables" targetRuntime="MyBatis3">
<!-- 为sql关键字添加分隔符 https://cloud.tencent.com/developer/article/1868889 -->
<property name="autoDelimitKeywords" value="true"/>
<property name="beginningDelimiter" value="`"/>
<property name="endingDelimiter" value="`"/>
<!-- optional旨在创建class时对注释进行控制 -->
<commentGenerator>
<!-- 不添加日期 -->
<property name="suppressDate" value="true"/>
<!-- 不添加所有注释 -->
<!--<property name="suppressAllComments" value="true"/>-->
<!-- 添加数据表中字段的注释 -->
<!--<property name="addRemarkComments" value="true"/>-->
</commentGenerator>
<!-- 数据库连接配置 -->
<!--
升级依赖后 driverClass 由 com.mysql.jdbc.Driver 改为 com.mysql.cj.jdbc.Driver
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'.
The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
-->
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver" connectionURL="${spring.datasource.url}"
userId="${spring.datasource.username}" password="${spring.datasource.password}">
<!--
禁止MyBatis使用其他数据库中的同名数据表
refer: https://blog.csdn.net/khsay/article/details/86478579
https://www.cnblogs.com/coderLeo/p/12770673.html
-->
<property name="nullCatalogMeansCurrent" value="true"/>
</jdbcConnection>
<!-- 生成 DataObject 类存放位置 -->
<javaModelGenerator targetPackage="plus.bookshelf.Dao.DO" targetProject="src/main/java">
<property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<!-- 生成映射文件存放位置 -->
<sqlMapGenerator targetPackage="mapping" targetProject="src/main/resources">
<property name="enableSubPackages" value="true"/>
</sqlMapGenerator>
<!-- 生成Dao类存放位置 -->
<!-- 客户端代码生成易于使用的针对Mode L对象和XML配置文件的代码
type="ANNOTATEDMAPPER",生成Java Model和基于注解的Mapper对象
type="MIXEDMAPPER",生成基于注解的Java Model和相应的Mapper对象
type="XM1LMAPPER",生成SQLMap XML文件和独立的Mapper接口
-->
<javaClientGenerator type="XMLMAPPER" targetPackage="plus.bookshelf.Dao.Mapper" targetProject="src/main/java">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<!--去除复杂操作语句-->
<!--enableCountByExample="false"-->
<!--enableUpdateByExample="false" -->
<!--enableDeleteByExample="false" -->
<!--enableSelectByExample="false"-->
<!--selectByExampleQueryId="false"-->
<!-- 生成对应表及其类名 -->
<!--<table tableName="book_info" domainObjectName="BookDO" enableCountByExample="false"-->
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="true"-->
<!-- selectByExampleQueryId="false"></table>-->
<!--<table tableName="category_info" domainObjectName="CategoryDO" enableCountByExample="false"-->
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
<!-- selectByExampleQueryId="false"></table>-->
<!--<table tableName="file_info" domainObjectName="FileDO" enableCountByExample="false"-->
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
<!-- selectByExampleQueryId="false"></table>-->
<!--<table tableName="file_object_info" domainObjectName="FileObjectDO" enableCountByExample="false"-->
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
<!-- selectByExampleQueryId="false"></table>-->
<!--<table tableName="user_info" domainObjectName="UserDO" enableCountByExample="false"-->
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
<!-- selectByExampleQueryId="false"></table>-->
<!--<table tableName="third_party_user_info" domainObjectName="ThirdPartyUserDO" enableCountByExample="false"-->
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
<!-- selectByExampleQueryId="false"></table>-->
<!--<table tableName="third_party_user_auth_relation" domainObjectName="ThirdPartyUserAuthDO" enableCountByExample="false"-->
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
<!-- selectByExampleQueryId="false"></table>-->
<!--<table tableName="user_book_favorites_relation" domainObjectName="UserFavoritesDO" enableCountByExample="false"-->
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
<!-- selectByExampleQueryId="false"></table>-->
<!--<table tableName="cos_presigned_url_generate_log" domainObjectName="CosPresignedUrlGenerateLogDO" enableCountByExample="false"-->
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
<!-- selectByExampleQueryId="false"></table>-->
<!--<table tableName="schedule_task" domainObjectName="ScheduleTaskDO" enableCountByExample="false"-->
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
<!-- selectByExampleQueryId="false"></table>-->
<!--<table tableName="failure_feedback" domainObjectName="FailureFeedbackDO" enableCountByExample="false"-->
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
<!-- selectByExampleQueryId="false"></table>-->
<!--<table tableName="visitor_fingerprint_log" domainObjectName="VisitorFingerprintLogDO" enableCountByExample="false"-->
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
<!-- selectByExampleQueryId="false"></table>-->
</context>
</generatorConfiguration>