use of org.webpieces.plugins.hibernate.app.dbo.Role in project webpieces by deanhiller.
the class CrudTestController method multiSelect.
public Render multiSelect(Integer id) {
if (id == null) {
return Actions.renderThis("entity", new UserTestDbo(), "levels", LevelEducation.values(), "roles", Role.values(), "selectedRoles", new ArrayList<>());
}
UserTestDbo user = UserTestDbo.findWithJoin(Em.get(), id);
List<UserRoleDbo> roles = user.getRoles();
List<Role> selectedRoles = roles.stream().map(r -> r.getRole()).collect(Collectors.toList());
return Actions.renderThis("entity", user, "levels", LevelEducation.values(), "roles", Role.values(), "selectedRoles", selectedRoles);
}
Aggregations