bean.createEmployee("Tom Brady", "New England Patriots", 1);
answer = bean.getEmployee(1).getName();
break;
}
case GET_EMPLOYEE: {
Employee employee = bean.getEmployee(1);
if (employee == null) {
throw new ServletException("couldn't load Employee entity (with id=1) from database");
}
answer = employee.getName();
break;
}
case DELETE_EMPLOYEE: {
bean.deleteEmployee(1);
answer = command.toString();
break;
}
case GET_EMPLOYEES_IN_2LC: {
long count = bean.getEmployeesInMemory();
if (count == -1) {
throw new ServletException("couldn't get number of employees in second level cache");
}
answer = String.valueOf(count);
break;
}
case GET_2ND_BEAN_EMPLOYEE: {
Employee employee = bean.getSecondBeanEmployee(1);
answer = employee.getName();
break;
}
case DESTROY: {
bean.destroy();
answer = command.toString();