I am trying to use ModelMapper to map a collection of Role Entity into a list of the names of the roles that the user have.
I tried a lot of things but nothing is working properly.
public class User {
private int id;
private String name;
private Set<Role> roles;
}
public class Role {
private int id;
private String name;
private boolean admin;
}
public class UserDto {
private int id;
private String name;
private Set<String> rolenames;
}
An extra question : Is the modelmapper a good choice for this use case ?
Thanks !