@Override
    public Object findByName(String theName) throws Exception {
        try {
            session = HibernateUtil.getSessionFactory().openSession();
            //Query q = session.getNamedQuery("name.igual");
            Query q = session.getNamedQuery(getNamedQueryToFindByName());
            q.setString("name", theName);
            Object o = q.uniqueResult();
            return o;
        } catch (HibernateException e) {
            throw new Exception(e.getCause().getMessage());
        } finally {
            releaseSession(session);
        }
    }