mirror of
https://gitee.com/easii/mapstruct-plus.git
synced 2025-12-06 17:18:43 +08:00
fix issue#8;
增加寻找Mapper缓存,转换更快; 重新使用jdk17打包
This commit is contained in:
parent
555d914712
commit
5a5d181875
@ -46,24 +46,23 @@ copyright: false
|
||||
<dependency>
|
||||
<groupId>io.github.linpeilie</groupId>
|
||||
<artifactId>mapstruct-plus-spring-boot-starter</artifactId>
|
||||
<version>1.1.6</version>
|
||||
<version>1.1.7</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
- gradle
|
||||
|
||||
```groovy
|
||||
implementation group: 'io.github.linpeilie', name: 'mapstruct-plus-spring-boot-starter', version: '1.1.6'
|
||||
implementation group: 'io.github.linpeilie', name: 'mapstruct-plus-spring-boot-starter', version: '1.1.7'
|
||||
```
|
||||
|
||||
## 更新日志
|
||||
|
||||
### 1.1.6
|
||||
### 1.1.7
|
||||
|
||||
- 支持在添加 `AutoMapper` 的类中,配置目标类到当前类的转换规则,适配多种场景下的使用;
|
||||
- `AutoMapper` 增加注解,提供可以配置是否生成转换接口的功能;
|
||||
- `AutoMapping` 的 `target` 属性默认可以不填,不填则取当前字段
|
||||
- 升级 mapstruct 版本为 1.5.3.FINAL
|
||||
- fixBug: [issue#8](https://github.com/linpeilie/mapstruct-plus/issues/11) Converter 转换已有对象不生效的问题
|
||||
- 添加寻找转换接口的缓存,转换速度更快
|
||||
- 使用 Java 17 打包,解决 Java 17 环境下编译警告的问题
|
||||
|
||||
……
|
||||
|
||||
|
||||
@ -6,6 +6,12 @@ category:
|
||||
description: MapStructPlus release log
|
||||
---
|
||||
|
||||
## 1.1.7
|
||||
|
||||
- fixBug: [issue#8](https://github.com/linpeilie/mapstruct-plus/issues/11) Converter 转换已有对象不生效的问题
|
||||
- 添加寻找转换接口的缓存,转换速度更快
|
||||
- 使用 Java 17 打包,解决 Java 17 环境下编译警告的问题
|
||||
|
||||
## 1.1.6
|
||||
|
||||
- 支持在添加 `AutoMapper` 的类中,配置目标类到当前类的转换规则,适配多种场景下的使用;
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<mapstruct.version>1.5.1.Final</mapstruct.version>
|
||||
<mapstruct-plus.version>1.1.6</mapstruct-plus.version>
|
||||
<mapstruct-plus.version>1.1.7</mapstruct-plus.version>
|
||||
<lombok.version>1.18.22</lombok.version>
|
||||
</properties>
|
||||
|
||||
|
||||
@ -171,6 +171,9 @@ public class QuickStartTest {
|
||||
goods.setSku(sku);
|
||||
|
||||
final GoodsVo goodsVo = converter.convert(goods, GoodsVo.class);
|
||||
|
||||
final GoodsVo newGoodsVo = new GoodsVo();
|
||||
converter.convert(goods, newGoodsVo);
|
||||
System.out.println(goodsVo);
|
||||
}
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ public abstract class AbstractCachedConverterFactory implements ConverterFactory
|
||||
@SuppressWarnings("unchecked")
|
||||
public <S, T> BaseMapper<S, T> getMapper(final Class<S> sourceType, final Class<T> targetType) {
|
||||
final String key = key(sourceType, targetType);
|
||||
if (mapperMap.contains(key)) {
|
||||
if (mapperMap.containsKey(key)) {
|
||||
return mapperMap.get(key);
|
||||
}
|
||||
final BaseMapper mapper = findMapper(sourceType, targetType);
|
||||
@ -26,7 +26,7 @@ public abstract class AbstractCachedConverterFactory implements ConverterFactory
|
||||
@Override
|
||||
public <S> BaseMapMapper<S> getMapMapper(final Class<S> sourceType) {
|
||||
final String key = sourceType.getName();
|
||||
if (mapMapperMap.contains(key)) {
|
||||
if (mapMapperMap.containsKey(key)) {
|
||||
return mapMapperMap.get(key);
|
||||
}
|
||||
final BaseMapMapper mapper = findMapMapper(sourceType);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user