![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Hibernate
ztf200
这个作者很懒,什么都没留下…
展开
-
表外键在SQL语句中的取法
有两张表(question、answer),它们存在着一对多关系(question->answer)和多对一关系(answer->question)。在Answer.java中定义有:public class Answer {private String userid;private Question question;private int qid;}在answer.hbm.xml中有:原创 2009-03-20 17:14:00 · 206 阅读 · 0 评论 -
Hibernate中hql的语句问题
org.hibernate.hql.ast.QuerySyntaxError: user is not mapped. [from user as u where u.userid=?] 出现这个问题,主要是hibernate语句不对.User.hbm.xml为:User" table="user" >因此,hql 语句如下:String hql = "from User as原创 2009-03-20 17:18:00 · 227 阅读 · 0 评论