MapStruct ignore automatically unmapped properties

前端 未结 2 2095
执念已碎
执念已碎 2020-12-09 02:24

I am using MapStruct with big models (more than 50 fields) shared between different business use cases in my code. Depending on the entry point, some properties will be mapp

2条回答
  •  我在风中等你
    2020-12-09 02:39

    For ignore automapping MapStruct 1.3.0.Final Reference Guide:

    By means of the @BeanMapping(ignoreByDefault = true) the default behavior will be explicit mapping, meaning that all mappings have to be specified by means of the @Mapping and no warnings will be issued on missing target properties.

    @BeanMapping(ignoreByDefault = true)
    OneObj map(TwoObj two);
    

提交回复
热议问题