mapstruct version: 1.4.1.Final
jdk version: 8
public class Driver {
private String sourceName;
private String pathName;
}
public class DriverDTO {
private String szName;
private String pName;
}
@Mapper
public interface DriverMapper {
@Mapping(source = "sourceName", target = "szName")
@Mapping(source = "parentName", target = "pName")
DriverDTO driverToDriverDTO(Driver driver);
}
when I compile these class, I get a compile error.
Error:(26, 12) java: Unknown property "pName" in result type DriverDTO. Did you mean "PName"?
but I make target = "pName" -> target = "PName" , I get a correct result.