简体   繁体   English

如何在 Spring Boot 中使用 Dozer 并排除一些属性

[英]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.

相关问题 如何在Spring Boot中使用Dozer? - How to use Dozer with Spring Boot? Spring 引导拦截器 - 如何排除一些 URL - Spring Boot interceptor - how to exclude some URL 如何避免在spring boot java应用程序中推土机映射空白字符串? - How to avoid dozer mapping blank strings in spring boot java app? 如何排除默认的application.properties在Spring启动项目的Maven中使用配置文件添加自定义属性文件? - How to exclude default application.properties add custom properties file using profiles in maven for spring boot project? 如何使用推土机事件 - how to use Dozer Event 与Spring引导devtools相关的推土机映射异常 - A dozer map exception related to Spring boot devtools 如何在 Spring Boot 服务中使用 text.properties? - How to use text.properties in Spring Boot Service? 如何在 Spring Boot application.properties 中使用 Eclipse 变量 - How to use Eclipse Variables in Spring Boot application.properties 如何在 spring 引导中使用带有 application.properties 的环境变量? - How to use environment variables with application.properties in spring boot? 如何在Spring Boot中将YAML属性与构造函数注入配合使用? - How can I use YAML properties with constructor injection in Spring Boot?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM