Posted on 2010-01-13 23:22
断点 阅读(250)
评论(0) 编辑 收藏 所属分类:
Hibernate
org.hibernate.hql.ast.QuerySyntaxError: user is not mapped. [from user as u where u.userid=?]
出现这个问题,主要是hibernate语句不对。
User.hbm.xml为:
<hibernate-mapping>
<class name="org.lxh.myzngt.vo.User" table="user" >
<id name="id" type="java.lang.Integer">
<column name="id" />
<generator class="native"></generator>
</id>
</class>
</hibernate-mapping>
因此,hql 语句如下:
String hql = "from User as u where u.userid=?"
posted @ 2009-02-11 17:55 断点 阅读(109) | 评论 (0)