LazyLoadEnum.USER_ROLES, LazyLoadEnum.NONE } });
JobFunctionManager jobFunctionManager = (JobFunctionManager) ModelUtil
.getBean("jobFunctionManager");
if (user == null) {
UserTypeManager userTypeManager = (UserTypeManager) ModelUtil
.getBean("userTypeManager");
JobFunction jobFunction = new JobFunction();
jobFunction.setJobFunctionName("Transport");
List<JobFunction> jobFunctions = jobFunctionManager
.findByObject(jobFunction);
jobFunction = jobFunctions.get(0);
user = new ApplicationUser(null, "avviktransport",
"avviktransport", "avviktransport", "avviktransport", null,
"Nei", jobFunction, productArea, null);
applicationUserManager.saveObject(user);
UserType userType = new UserType();
userType.setDescription("Avvik");
List<UserType> userTypes = userTypeManager.findByObject(userType);
userType = userTypes.get(0);
Set<UserRole> userRoles = new HashSet<UserRole>();
UserRole userRole = new UserRole(null, userType, user);
userRoles.add(userRole);