Skip to content

Mapstruct defaultValue not working #132

@lalkhum

Description

@lalkhum

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions