That works really well. Thank you!

Marc

2009/1/18 tonylu880042 <[email protected]>

>
> Hi,
> You should also add the class mapping in
> src/test/resources/hibernate.cfg.xml.
> tony
>
>
> Marc_13 wrote:
> >
> > Hello,
> >
> > I have the following errors when running  *'mvn test -Dtest=PersonDaoTest
> > -Dsurefire.useFile=false' *, while following the Hibernate tutorial:
> > testFindPersonByLastName(org.appfuse.dao.PersonDaoTest)  Time elapsed:
> > 6.478
> > sec  <<< ERROR!
> > java.lang.IndexOutOfBoundsException: Remember that ordinal parameters are
> > 1-based!
> >         at
> >
> org.hibernate.engine.query.ParameterMetadata.getOrdinalParameterDescriptor(ParameterMetadata.java:55)
> >         at
> >
> org.hibernate.engine.query.ParameterMetadata.getOrdinalParameterExpectedType(ParameterMetadata.java:61)
> >         at
> >
> org.hibernate.impl.AbstractQueryImpl.determineType(AbstractQueryImpl.java:397)
> >         at
> >
> org.hibernate.impl.AbstractQueryImpl.setParameter(AbstractQueryImpl.java:369)
> > [...]
> >
> > testAddAndRemovePerson(org.appfuse.dao.PersonDaoTest)  Time elapsed:
> 0.033
> > sec  <<< ERROR!
> > org.springframework.orm.hibernate3.HibernateSystemException: Unknown
> > entity:
> > org.appfuse.model.Person; nested exception is
> > org.hibernate.MappingException: Unknown entity: org.appfuse.model.Person
> >         at
> >
> org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:661)
> >         at
> >
> org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
> >         at
> >
> org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
> >         at
> >
> org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
> >         at
> >
> org.springframework.orm.hibernate3.HibernateTemplate.merge(HibernateTemplate.java:820)
> >         at
> >
> org.appfuse.dao.hibernate.GenericDaoHibernate.save(GenericDaoHibernate.java:96)
> >         at
> >
> org.appfuse.dao.PersonDaoTest.testAddAndRemovePerson(PersonDaoTest.java:25)
> > [;..]
> >
> > Entity Person exists:
> > $ ls -al target/classes/org/appfuse/model/Person.class
> > -rw-r--r-- 1 marc marc 2719 Jan 17 22:46
> > target/classes/org/appfuse/model/Person.class
> >
> > Marc
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/what-did-I-miss-in-Using-Hibernate-tutorial---tp21521243s2369p21528567.html
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to