public void removeRole(User user, Role role) throws Exception {
        
        try {
            session = HibernateUtil.getSessionFactory().openSession();
            Query q = session.getNamedQuery(getNamedQueryToRemoveRoleUser());
            q.setString("role", Integer.toString(role.getId()));
            q.executeUpdate();
        } catch (HibernateException e) {
            throw new Exception(e.getCause().getLocalizedMessage());
        } finally {
            releaseSession(session);
        }
        
    }