
Hibernate
文章平均质量分 73
limon758
这个作者很懒,什么都没留下…
展开
-
hibernate duplicate import,类重名
严重: Exception sending context initialized event to listener instance of class com.htsoft.core.web.listener.StartupListenerorg.springframework.beans.factory.BeanCreationException: Error creating bean...原创 2010-12-23 09:16:39 · 139 阅读 · 0 评论 -
SSH Hibernate The given object has a null identifier: com.ssh.dao.uinfo
The given object has a null identifier: com.ssh.dao.uinfocom.ssh.dao.uinfo这个实体类对象的主键值为空,需要给主键赋值黑色头发:http://heisetoufa.iteye.com/原创 2011-07-18 15:36:50 · 105 阅读 · 0 评论 -
hibernate hql执行in语句
假设List a;a里面已经有数据了,则HQL查询条件可以为:[code="java"]String hql = "from Tab o where o.id in (:id)"; Query q ;List idList = new ArrayList();idList.add(1);idList.add(2);q.setParameterList("id...原创 2012-06-25 14:19:11 · 567 阅读 · 0 评论 -
hibernate 中关于自增主键
hibernate提供了产生自动增长类型主键的多种策略,这里以increment为例说明具体用法:1、在数据库中建立表,主键名称为ID,类型为varchar2(字符串型) 2、在**.hbm.xml(hibernate映射文件)中配置如下 //该句指定使用hibernate自带的increment策略生成主键 3、在java文件中对表增加记录时,只需添加除ID外的...原创 2012-04-12 17:02:57 · 289 阅读 · 0 评论 -
ssh2 could not get next sequence value
主键生成方式为:native但当添加数据的时候会报错could not get next sequence value经检查是hibernate.dialect的值设置错了要么改正,要么干脆删掉黑色头发:http://heisetoufa.iteye.com/...原创 2012-08-28 15:38:35 · 173 阅读 · 0 评论