I have these two classes:
public class CustomerEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;
private String firstName;
private String lastName;
private String address;
private int age;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
}
and
public class CustomerDto {
private Long customerId;
private String firstName;
private String lastName;
private Optional<String> address;
private int age;
}
The problem is that Mapstruct doesn't recognize the Optional variable "address".
Anyone has an idea how to solve it and let Mapstruct map Optional fields?