随笔分类 -  Hibernate

Caused by: org.hibernate.NonUniqueObjectException
摘要:在做项目中碰见这样的问题,如下:Caused by: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [com.pcis.cus.vo.CusClientVO#002255207]; 原... 阅读全文
posted @ 2009-10-31 13:11 断点 阅读(785) 评论(0) 推荐(0)
表外键在SQL语句中的取法
摘要:有两张表(question、answer),它们存在着一对多关系(question->answer)和多对一关系(answer->question)。 在Answer.java中定义有: public class Answer { private String userid; private Question question; private int qid; } 在a... 阅读全文
posted @ 2009-02-23 15:58 断点 阅读(433) 评论(0) 推荐(0)
Hibernate中hql的语句问题
摘要:org.hibernate.hql.ast.QuerySyntaxError: user is not mapped. [from user as u where u.userid=?] 出现这个问题,主要是hibernate语句不对。 User.hbm.xml为: 因此,hql 语句如下: Strin... 阅读全文
posted @ 2009-02-11 17:55 断点 阅读(331) 评论(0) 推荐(0)