在使用Hibernate时候出现 category is not mapped[from category] 错误
数据库表名为category, 存在cid和cname列
Category.hbm.xml:
<class name="com.liang.vo.Category" table="category">
<id name="cid">
<generator class="native"/>
</id>
<property name="cname"/>
</class>
applicationContext.xml:
<value>com/liang/vo/Category.hbm.xml</value>
String hql="from category";
List<Category> list = this.getHibernateTemplate().find(hql);
错误原因:hql语句的表名应该是ORM映射类名,
String hql="from Category";