Query query = session.getNamedQuery("findinternaluserbyidanddeptid");
query.setParameter("employeeId", id);
query.setParameter("deptid", deptid);
System.out.println("size of list is: "+query.list().size());
if (query.list().size() == 0)
throw new InternalException("User ID does not exist in this Department!");
List<?> list = query.list();
logger.info("Internal Account -- Searched-- Employee Id " + id);
return (InternalAccount)list.get(0);