@Override
    public Object findById(Integer theId) throws Exception {
        try {
            session = HibernateUtil.getSessionFactory().openSession();
            //Query q = session.getNamedQuery("id.igual");
            Query q = session.getNamedQuery(getNamedQueryToFindById());
            q.setString("id", theId.toString());
            Object o = q.uniqueResult();
            return o;
        } catch (HibernateException e) {
            throw new Exception(e.getCause().getMessage());
        } finally {
            releaseSession(session);
        }
    }