mapstruct-examples
mapstruct-examples copied to clipboard
Mapstruct defaultValue not working
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.