Skip to content

Cannot map nested target when mapping from Map to Bean #2624

@filiphr

Description

@filiphr
public class Employee {
    private String id;
    private String name;
    private Department department
}


public class Department {
    private String id;
    private String name;
}

And the mapper

@Mapper
public interface MapToBeanMapper {

    @Mapping(target = "department.id", source = "did")
    @Mapping(target = "department.name", source = "dname")
    Employee fromMap(Map<String, String> map);
}

Will not generate the correct code.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions