日期:2014-05-20  浏览次数:20899 次

org.springframework.orm.hibernate3.HibernateQueryException: Manager is not mappe

?

用hibernateTemplate().find()方法时出现以下错误

org.springframework.orm.hibernate3.HibernateQueryException: Manager is not mapped [from Manager]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: Manager is not mapped [from Manager]

?

纠结了好长时间,上网一查才知道好多人出现过相同问题,原因一般有:

?

1,hbm.xml 没在beans.xml中配置

?

可我有啊

?

<property name="packagesToScan">

<list><value>com.fzb.shop.entity</value></list>?

?</property>

?

?

2,find()方法中的类名未写全

?

我原来是

this.getHibernateTemplate().find("from Manager");

?

应该为

this.getHibernateTemplate().find("from com.fzb.shop.entity.Manager");

?

但还是有些纠结,以后难道每个类名都得写全吗?有其他办法吗?


?