private TutorEntity lookupTutor(String staffNum) {
        TutorEntity t = new TutorEntity();
        try {
            Query q = em.createQuery("SELECT t FROM Tutor AS t WHERE t.staffNumber=:staffNumber");
            q.setParameter("staffNumber", staffNum);
            t = (TutorEntity) q.getSingleResult();
        } catch (EntityNotFoundException e) {
            System.out.println("ERROR: Tutor not found. " + e.getMessage());
            em.remove(t);
            return null;
        } catch (NoResultException e) {
            System.out.println("ERROR: Tutor does not exist. " + e.getMessage());
            em.remove(t);
            return null;
        }
        return t;
    }