当前位置: 代码迷 >> .NET Framework >> org.springframework.orm.hibernate3.HibernateQueryException: Manager is not 地图pe
  详细解决方案

org.springframework.orm.hibernate3.HibernateQueryException: Manager is not 地图pe

热度:26   发布时间:2016-05-02 00:21:28.0
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");

?

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


?

  相关解决方案