pero... ¿donde lo busca? ¿Si he de crearlo yo, donde he de hacerlo?...
Por favor, un ayudita que esto es desesperante y ya no puedo más.
Gracias
Código:
package example.hibernate; // Generated 21-ene-2007 17:25:15 by Hibernate Tools 3.2.0.beta8 import java.util.List; import javax.naming.InitialContext; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.hibernate.LockMode; import org.hibernate.SessionFactory; import org.hibernate.criterion.Example; /** * Home object for domain model class Person. * @see example.hibernate.Person * @author Hibernate Tools */ public class PersonHome { private static final Log log = LogFactory.getLog(PersonHome.class); private final SessionFactory sessionFactory = getSessionFactory(); protected SessionFactory getSessionFactory() { try { return (SessionFactory) new InitialContext() .lookup("SessionFactory"); } catch (Exception e) { log.error("Could not locate SessionFactory in JNDI", e); throw new IllegalStateException( "Could not locate SessionFactory in JNDI"); } } public void persist(Person transientInstance) { log.debug("persisting Person instance"); try { sessionFactory.getCurrentSession().persist(transientInstance); log.debug("persist successful"); } catch (RuntimeException re) { log.error("persist failed", re); throw re; } } public void attachDirty(Person instance) { log.debug("attaching dirty Person instance"); try { sessionFactory.getCurrentSession().saveOrUpdate(instance); log.debug("attach successful"); } catch (RuntimeException re) { log.error("attach failed", re); throw re; } } public void attachClean(Person instance) { log.debug("attaching clean Person instance"); try { sessionFactory.getCurrentSession().lock(instance, LockMode.NONE); log.debug("attach successful"); } catch (RuntimeException re) { log.error("attach failed", re); throw re; } } public void delete(Person persistentInstance) { log.debug("deleting Person instance"); try { sessionFactory.getCurrentSession().delete(persistentInstance); log.debug("delete successful"); } catch (RuntimeException re) { log.error("delete failed", re); throw re; } } public Person merge(Person detachedInstance) { log.debug("merging Person instance"); try { Person result = (Person) sessionFactory.getCurrentSession().merge( detachedInstance); log.debug("merge successful"); return result; } catch (RuntimeException re) { log.error("merge failed", re); throw re; } } public Person findById(int id) { log.debug("getting Person instance with id: " + id); try { Person instance = (Person) sessionFactory.getCurrentSession().get( "example.Person", id); if (instance == null) { log.debug("get successful, no instance found"); } else { log.debug("get successful, instance found"); } return instance; } catch (RuntimeException re) { log.error("get failed", re); throw re; } } public List findByExample(Person instance) { log.debug("finding Person instance by example"); try { List results = sessionFactory.getCurrentSession().createCriteria( "example.Person").add(Example.create(instance)).list(); log.debug("find by example successful, result size: " + results.size()); return results; } catch (RuntimeException re) { log.error("find by example failed", re); throw re; } } }