I'm trying to map this:
public class UserInfoDTO {
private String addressDto;
}
public class B extends UserInfoDTO {
private String roleId;
}
public class A extends UserInfoDTO {
private String groupId;
}
from:
public class Entity {
private Address address;
}
Address contains some fields and "String city" field.
I want to map between the Entity and the DTOs
@Mapper(componentModel = "jsr330")
public interface IUserMapper {
A aFromEntity (Entity entity);
B bFromEntity (Entity entity);
@Mappings({
@Mapping(target = "addressDto", source = "entity.address.city")
})
UserInfoDTO fromEntity (Entity entity);
}
But I get a compilation failure that "can't map property Address address to String addressDto". Please help :)