通用 Mapper 4.0.3 发布,完美支持 devtools

栏目: 软件资讯 · 发布时间: 7年前

内容简介:通用 Mapper 4.0.3 已发布,该版本从根本上解决了通用 Mapper 对 devtools 的支持。 但是 https://github.com/abel533/mapper-cast-exception 中列举的特殊情况在目前都不支持(mybatis也支持不了)。 同时 ma...

通用 Mapper 4.0.3 已发布,该版本从根本上解决了通用 Mapper 对 devtools 的支持。

但是 https://github.com/abel533/mapper-cast-exception 中列举的特殊情况在目前都不支持(mybatis也支持不了)。

同时 mapper-spring-boot-starter 发布了 2.0.3。

其他 Spring Boot 类的项目如果想要完美支持 devtools,可以参考本项目的实现。

实现思路很简单,就是在 devtools 重启时,把所有和 Class 有关的缓存全部清空即可。

参考代码:

https://gitee.com/free/Mapper/blob/master/spring-boot-starter/mapper-spring-boot-autoconfigure/src/main/java/tk/mybatis/mapper/autoconfigure/MapperCacheDisabler.java

配置代码:

https://gitee.com/free/Mapper/blob/master/spring-boot-starter/mapper-spring-boot-autoconfigure/src/main/java/tk/mybatis/mapper/autoconfigure/MapperAutoConfiguration.java

具体配置代码如下:

/**
 * Support Devtools Restart.
 */
@org.springframework.context.annotation.Configuration
@ConditionalOnProperty(prefix = "spring.devtools.restart", name = "enabled", matchIfMissing = true)
static class RestartConfiguration {

	@Bean
	public MapperCacheDisabler mapperCacheDisabler() {
		return new MapperCacheDisabler();
	}

}

【声明】文章转载自:开源中国社区 [http://www.oschina.net]


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Machine Learning in Action

Machine Learning in Action

Peter Harrington / Manning Publications / 2012-4-19 / GBP 29.99

It's been said that data is the new "dirt"—the raw material from which and on which you build the structures of the modern world. And like dirt, data can seem like a limitless, undifferentiated mass. ......一起来看看 《Machine Learning in Action》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具