I want to map two object with mapStruct
public class EntityA
{
@Id
private String id;
@Column
private String anotherField
The second object with an object a paramter
public class ABC
{
private final ObjectXYZ identification;
// another fields
public class ObjectXYZ
{
private final String identification;
My Mapper:
@Mapper
public interface ObjectMapper
{
@Mapping(target = "identification", source = "identification", qualifiedByName = "ObjectXYZ")
ABC toABC(EntityA entity);
EntityA toEntityA(Material material);
@Named("ObjectXYZ")
@Mapping(target = "identification", source = "identification")
ObjectXYZ toObjectXYZ(String identification);
}
how can i map the EntityA.id to ABC.identification.identification