}
private Users createUserEntityAndRelateRole(String role) {
List<Roles> webUserRoleList=null;
logger.log(Level.INFO, "Parameters input are = {0}, {1}, {2}, {3}", new Object[]{username, password, mailinglist, email});
Users user = new Users();
user.setUsername(username);
user.setPassword(password);
user.setEmail(email);
boolean b = false;
try {
webUserRoleList = DBInitializer.getRoleByID(role);
} catch (Exception e) {
logger.log(Level.SEVERE, "Role: WebUser retrival failed. {0}", e.getMessage());
}
user.setRolesList(webUserRoleList);
if (mailinglist == true) {
user.setMailinglist(Character.valueOf('Y'));
} else {
user.setMailinglist(Character.valueOf('N'));
}
logger.log(Level.INFO, "User Role List: {0}", user.getRolesList().listIterator().next().toString());
return user;
}