public static void runDemo(EntityManager em, Context rootContext)
	{
		SickEntryService sickEntryService = rootContext.lookupService("SickEntryService", SickEntryService.class);
		SickEntry sickEntry = sickEntryService.createSickEntry(new Date(), 3);
		System.out.println("Created entry is " + sickEntry);
		em.clear();
		sickEntry = sickEntryService.findSickEntry(sickEntry.getId());
		System.out.println("Sick entry after lookup in database: " + sickEntry);
		
		EmployeeService empService = rootContext.lookupService("EmployeeService", EmployeeService.class);
		DepartmentService depService = rootContext.lookupService("DepartmentService", DepartmentService.class);
		ParkingSpaceService psService = rootContext.lookupService("ParkingSpaceService", ParkingSpaceService.class);
		ProjectService projectService = rootContext.lookupService("ProjectService", ProjectService.class); 
		PhoneService phoneService = rootContext.lookupService("PhoneService", PhoneService.class);
		CompanyService companyService = rootContext.lookupService("CompanyService", CompanyService.class);
		
		Department javaDep = depService.createDepartment("J2");
		Department netDep = depService.createDepartment(".NET");
		
		ParkingSpace firstSpace = psService.createParkingSpace(1, "Space 1");
		ParkingSpace secondSpace = psService.createParkingSpace(2, "Space 2");
		ParkingSpace thirdSpace = psService.createParkingSpace(3, "Space 3");
		ParkingSpace fourthSpace = psService.createParkingSpace(3, "Space 4");
		
		Address firstAddress = new Address("Elm Street", "NY", "USA");
		Address secondAddress = new Address("State Street", "Boston", "USA");
		Address thirdAddress = new Address("Wall Street", "NY", "USA");
		Address fourthAddress = new Address("Palm Street", "Quincy", "USA");
		
		Company firstCompany = companyService.createNewCompany("SRI Infotech", secondAddress);
		Company secondCompany = companyService.createNewCompany("Valeo Inc.", fourthAddress);
		
		Employee firstEmployee = empService.createEmployee("Tommy Tester", 1500, new Date(), "Bad", EmployeeType.FULL_TIME, firstCompany, firstAddress, javaDep.getId(), firstSpace.getId());
		Employee secondEmployee = empService.createEmployee("Sam Coder", 2500, new Date(1989,10,30), "Good", EmployeeType.PART_TIME, secondCompany, secondAddress ,netDep.getId(), secondSpace.getId());
		Employee thirdEmployee = empService.createEmployee("Jimmy Hacker", 3500, new Date(), "Bad", EmployeeType.FULL_TIME, secondCompany ,thirdAddress, netDep.getId(), thirdSpace.getId());
		Employee fourthEmployee = empService.createEmployee("Sally Cleaner", 3500, new Date(), "Bad", EmployeeType.FULL_TIME, secondCompany, fourthAddress, netDep.getId(), fourthSpace.getId());
		
		empService.addNickNameToEmployee(firstEmployee, "Hitman");
		empService.addNickNameToEmployee(firstEmployee, "Batman");
		empService.addNickNameToEmployee(thirdEmployee, "Catman");
		
		empService.addVacationToEmployee(thirdEmployee, new VacationEntry(new Date(), 10));
		empService.addVacationToEmployee(thirdEmployee, new VacationEntry(new Date(System.currentTimeMillis() + 20 * 24 * 60 * 60 * 1000), 10));
		
		Project sriProject = projectService.createProject("SRI");
		Project valeoProject = projectService.createProject("Valeo");
		
		Phone firstEmpHomePhone = phoneService.createPhone("948454", PhoneType.HOME);
		Phone firstEmpMobilePhone = phoneService.createPhone("3435543534534", PhoneType.MOBILE);
		Phone secondEmpMobilePhone = phoneService.createPhone("4353452345", PhoneType.MOBILE);
		Phone thirdEmployeeMobilePhone = phoneService.createPhone("345234523456547", PhoneType.MOBILE);
		Phone fourthEmployeeMobilePhone = phoneService.createPhone("43534523546", PhoneType.MOBILE);
		
		projectService.addEmployeeToProject(firstEmployee.getId(), sriProject.getId());
		projectService.addEmployeeToProject(secondEmployee.getId(), valeoProject.getId());
		projectService.addEmployeeToProject(thirdEmployee.getId(), valeoProject.getId());
		projectService.addEmployeeToProject(fourthEmployee.getId(), valeoProject.getId());
		
		phoneService.addPhoneToEmployee(firstEmployee.getId(), firstEmpMobilePhone);
		phoneService.addPhoneToEmployee(firstEmployee.getId(), firstEmpHomePhone);
		phoneService.addPhoneToEmployee(secondEmployee.getId(), secondEmpMobilePhone);
		phoneService.addPhoneToEmployee(thirdEmployee.getId(), thirdEmployeeMobilePhone);
		phoneService.addPhoneToEmployee(fourthEmployee.getId(), fourthEmployeeMobilePhone);
		
		System.out.println("SRI project " + sriProject);
		System.out.println("Valeo project " + valeoProject);
		
		System.out.println("First employee is " + firstEmployee);
		System.out.println("Second employee is " + secondEmployee);
		System.out.println("Third employee is " + thirdEmployee);
		System.out.println("Fourth employee is " + fourthEmployee);
		
		em.refresh(sriProject);
		em.refresh(valeoProject);
		em.refresh(firstEmployee);
		em.refresh(secondEmployee);
		em.refresh(thirdEmployee);
		em.refresh(fourthEmployee);
		
		System.out.println("SRI project after refresh " + sriProject);
		System.out.println("Valeo project project after refresh " + valeoProject);
		
		System.out.println("First employee is project after refresh " + firstEmployee);
		System.out.println("Second employee is project after refresh " + secondEmployee);
		System.out.println("Third employee is project after refresh " + thirdEmployee);
		System.out.println("Fourth employee is project after refresh " + fourthEmployee);
	}