public List<User> findUser(Role role) throws Exception {
        
        try {
            session = HibernateUtil.getSessionFactory().openSession();
            session.beginTransaction();
            Query q = session.getNamedQuery(getNamedQueryToFindUser());
            q.setInteger("role", (role.getId()));
            List lt = q.list();
            session.getTransaction().commit();
            return lt;
        } catch (HibernateException e) {
            throw new Exception(e.getCause().getLocalizedMessage());
        } finally {
            releaseSession(session);
        }
        
    }