.lazyLoad(
login.getApplicationUser(),
new LazyLoadEnum[][] {{LazyLoadEnum.USER_ROLES,LazyLoadEnum.NONE}});
Set<UserRole> roles = login.getApplicationUser().getUserRoles();
UserType userType;
UserRole userRole = null;
if (roles != null) {
if (roles.size() > 1) {
userRole = (UserRole) JOptionPane.showInputDialog(null,
"Velg rolle", "Velg rolle",
JOptionPane.QUESTION_MESSAGE, null, roles.toArray(),
null);
} else if (roles.size() == 1) {
userRole = roles.iterator().next();
}
}
if (userRole != null) {
userType = userRole.getUserType();
login.setUserType(userType);
try {
Class<?> windowClass = Class.forName(userType
.getStartupWindow());
MainWindow mainWindow = (MainWindow)injector.getInstance(windowClass);