mapstruct-examples icon indicating copy to clipboard operation
mapstruct-examples copied to clipboard

Mapstruct defaultValue not working

Open lalkhum opened this issue 3 years ago • 0 comments

I have DTO

private String name = "name";

Mapper:

@Mapping(target = "name", defaultValue = "Mr Hello")

Default value gets set in my DB for null input but not for empty string "".

Does anyone know what's the issue here?

note: for Integer type and boolean type, the above Mapper defaultValue works for me.

lalkhum avatar Feb 19 '22 18:02 lalkhum