hibernate 关于 is not mapped的问题
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 (注解)