簡體   English   中英

如何在 Spring Boot 中使用 Dozer 並排除一些屬性

[英]How to use Dozer with Spring Boot and exclude some properties

我在 springboot 應用程序中使用了 Dozer,所以我放入了 pom.xml

<dependency>
    <groupId>com.github.dozermapper</groupId>
    <artifactId>dozer-spring-boot-starter</artifactId>
    <version>6.5.0</version>
</dependency>

現在我想從 2 個實體(id 字段)中排除一些字段,有一些注釋可以使用嗎? 或通過 xml(請提供示例)

tks

在要排除的字段上使用上述注釋。

在 dozer-config.xml 文件中做通配符=假

<mapping **wildcard="false"**>
    <class-a><package_name><class_name></class-a>
    <class-b><package_name><class_name></class-b>
</mapping>

@Mapping("this")

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM