Skip to content

Improper @BeanMapping(ignoreByDefault=true) treatment with Immutable target #1452

Description

@soberich

Having this

    @Mapping(target = "name",                                     source = "comp.employer.title")
//    @Mapping(target = "A",                                            ignore = true)
//    @Mapping(target = "B",                                            ignore = true)
//    @Mapping(target = "C",                                            ignore = true)
//    @Mapping(target = "D",                                            ignore = true)
...
    @BeanMapping(ignoreByDefault = true)
    ADTO map(A a);

works only if

@Getter
@Setter
@Builder(toBuilder = true)

but if target is immutable like

@Value
@Builder(toBuilder = true)

It somehow causes @BeanMapping(ignoreByDefault = true) do not work like as if it was not there.
It is said that Unmapped target properties: "A, B, C, D"
so you have to explicitly ignore them again.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions