As the title suggests i want to map a object to a set or list of objects using Mapstruct
I want The category DTO to be mapped to or added to the set of Categories
How can i do that with mapstruct
public class Brand {
<code>private Long id;
private String name;
private String description;
private Set<Category> categories = new HashSet<>();
private Set<SubCategory> subcategories = new HashSet<>();
</code>
<code>private Long id;
private String name;
private String description;
private Set<Category> categories = new HashSet<>();
private Set<SubCategory> subcategories = new HashSet<>();
</code>
private Long id;
private String name;
private String description;
private Set<Category> categories = new HashSet<>();
private Set<SubCategory> subcategories = new HashSet<>();
}
public class BrandDTO {
private Long id;
private String name;
private String description;
private CategoryDTO category;
}
New contributor
Nandatō Kisame is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.