+ -
当前位置:首页 → 问答吧 → hibernate 关于 is not mapped的问题

hibernate 关于 is not mapped的问题

时间:2011-12-06

来源:互联网

public List<Category> getAllCategorys() throws Exception {
String hql = "from Category";
List<Category> list = getHibernateTemplate().find(hql);
logger.info("category size: "+list.size());
return list;
}

我在程序中执行以上方法时,出现“ Category is not mapped [from Category] ”异常(我的实体类名就是Category)

请问是什么问题啊,,,,?

把“from Category”改成 “from com.fjx.music.models.Category”就没问题了。。。。。求解

applicationContext.xml配置

  <property name="packagesToScan">
<list>
<value>com.fjx.music.models</value>
</list>
</property>

使用struts2 + hibernate3 + spring2.5 (注解)

作者: xd_fjx   发布时间: 2011-12-06

23.00 up

作者: xd_fjx   发布时间: 2011-12-06

没人来帮帮吗。。。。

作者: xd_fjx   发布时间: 2011-12-07

热门下载

更多