forked from xkcoding/spring-boot-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
修改mapper.xml文件生成格式-->实现jdbcType无须手动修改
- Loading branch information
Showing
9 changed files
with
136 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
spring-boot-demo-codegen/src/main/resources/jdbc_type.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
tinyint=TINYINT | ||
smallint=SMALLINT | ||
mediumint=MEDIUMINT | ||
int=INTEGER | ||
integer=INTEGER | ||
bigint=BIGINT | ||
float=FLOAT | ||
double=DOUBLE | ||
decimal=DECIMAL | ||
bit=BIT | ||
char=CHAR | ||
varchar=VARCHAR | ||
tinytext=VARCHAR | ||
text=VARCHAR | ||
mediumtext=VARCHAR | ||
longtext=VARCHAR | ||
date=DATE | ||
datetime=DATETIME | ||
timestamp=TIMESTAMP | ||
blob=BLOB | ||
longblob=LONGBLOB |
79 changes: 79 additions & 0 deletions
79
spring-boot-demo-codegen/src/main/resources/logback-spring.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<configuration> | ||
<property name="FILE_ERROR_PATTERN" | ||
value="${FILE_LOG_PATTERN:-%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%t] %-40.40logger{39} %file:%line: %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> | ||
<include resource="org/springframework/boot/logging/logback/defaults.xml"/> | ||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | ||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
<level>INFO</level> | ||
</filter> | ||
<encoder> | ||
<pattern>${CONSOLE_LOG_PATTERN}</pattern> | ||
<charset>UTF-8</charset> | ||
</encoder> | ||
</appender> | ||
|
||
<appender name="FILE_INFO" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
<!--如果只是想要 Info 级别的日志,只是过滤 info 还是会输出 Error 日志,因为 Error 的级别高, 所以我们使用下面的策略,可以避免输出 Error 的日志--> | ||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> | ||
<!--过滤 Error--> | ||
<level>ERROR</level> | ||
<!--匹配到就禁止--> | ||
<onMatch>DENY</onMatch> | ||
<!--没有匹配到就允许--> | ||
<onMismatch>ACCEPT</onMismatch> | ||
</filter> | ||
<!--日志名称,如果没有File 属性,那么只会使用FileNamePattern的文件路径规则如果同时有<File>和<FileNamePattern>,那么当天日志是<File>,明天会自动把今天的日志改名为今天的日期。即,<File> 的日志都是当天的。--> | ||
<!--<File>logs/info.spring-boot-demo-logback.log</File>--> | ||
<!--滚动策略,按照时间滚动 TimeBasedRollingPolicy--> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
<!--文件路径,定义了日志的切分方式——把每一天的日志归档到一个文件中,以防止日志填满整个磁盘空间--> | ||
<FileNamePattern>logs/spring-boot-demo-logback/info.created_on_%d{yyyy-MM-dd}.part_%i.log</FileNamePattern> | ||
<!--只保留最近90天的日志--> | ||
<maxHistory>90</maxHistory> | ||
<!--用来指定日志文件的上限大小,那么到了这个值,就会删除旧的日志--> | ||
<!--<totalSizeCap>1GB</totalSizeCap>--> | ||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
<!-- maxFileSize:这是活动文件的大小,默认值是10MB,本篇设置为1KB,只是为了演示 --> | ||
<maxFileSize>2MB</maxFileSize> | ||
</timeBasedFileNamingAndTriggeringPolicy> | ||
</rollingPolicy> | ||
<!--<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">--> | ||
<!--<maxFileSize>1KB</maxFileSize>--> | ||
<!--</triggeringPolicy>--> | ||
<encoder> | ||
<pattern>${FILE_LOG_PATTERN}</pattern> | ||
<charset>UTF-8</charset> <!-- 此处设置字符集 --> | ||
</encoder> | ||
</appender> | ||
|
||
<appender name="FILE_ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender"> | ||
<!--如果只是想要 Error 级别的日志,那么需要过滤一下,默认是 info 级别的,ThresholdFilter--> | ||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> | ||
<level>Error</level> | ||
</filter> | ||
<!--日志名称,如果没有File 属性,那么只会使用FileNamePattern的文件路径规则如果同时有<File>和<FileNamePattern>,那么当天日志是<File>,明天会自动把今天的日志改名为今天的日期。即,<File> 的日志都是当天的。--> | ||
<!--<File>logs/error.spring-boot-demo-logback.log</File>--> | ||
<!--滚动策略,按照时间滚动 TimeBasedRollingPolicy--> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
<!--文件路径,定义了日志的切分方式——把每一天的日志归档到一个文件中,以防止日志填满整个磁盘空间--> | ||
<FileNamePattern>logs/spring-boot-demo-logback/error.created_on_%d{yyyy-MM-dd}.part_%i.log</FileNamePattern> | ||
<!--只保留最近90天的日志--> | ||
<maxHistory>90</maxHistory> | ||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | ||
<!-- maxFileSize:这是活动文件的大小,默认值是10MB,本篇设置为1KB,只是为了演示 --> | ||
<maxFileSize>2MB</maxFileSize> | ||
</timeBasedFileNamingAndTriggeringPolicy> | ||
</rollingPolicy> | ||
<encoder> | ||
<pattern>${FILE_ERROR_PATTERN}</pattern> | ||
<charset>UTF-8</charset> <!-- 此处设置字符集 --> | ||
</encoder> | ||
</appender> | ||
|
||
<root level="info"> | ||
<appender-ref ref="CONSOLE"/> | ||
<appender-ref ref="FILE_INFO"/> | ||
<appender-ref ref="FILE_ERROR"/> | ||
</root> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters