[英]How to use Dozer with Spring Boot and exclude some properties
I use Dozer in my springboot app, so I put in my pom.xml我在 springboot 应用程序中使用了 Dozer,所以我放入了 pom.xml
<dependency>
<groupId>com.github.dozermapper</groupId>
<artifactId>dozer-spring-boot-starter</artifactId>
<version>6.5.0</version>
</dependency>
And now I wanna to exclude some field from 2 entitys (id fields), there are some annotations do use?现在我想从 2 个实体(id 字段)中排除一些字段,有一些注释可以使用吗? or via xml (a sample please)或通过 xml(请提供示例)
tks tks
Use the above annotation on the fields which you want to be excluded.在要排除的字段上使用上述注释。
Inside the dozer-config.xml file do wildcard=false在 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.