简体   繁体   中英

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

<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? or via xml (a sample please)

tks

Use the above annotation on the fields which you want to be excluded.

Inside the dozer-config.xml file do wildcard=false

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

@Mapping("this")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM