今天在练习Hibernate的时候,突然碰到了一个这样的问题,在导出数据库的时候,抛出了org.hibernate.MappingNotFoundException异常,害的我郁闷了半天......
原创 2010-10-08 22:39:06
3275阅读
org.hibernate.StaleStateException: Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1(2) 1.主键是自动增长性,在添加时也会出现错误。 2.unsaved-value是个很重要的属性。Hibernate通过这个属性来判断一个对象应
原创 2010-11-04 19:15:59
924阅读
 其实,具体的解决方法很简单, 将持久层: hibernateTemplate.update(chidClass); 改为:        hibernateTemplate.merge(chidClass); 原因: 使用 hibernate 3 的 merge 方法. session.merge(entity)即可,它
原创 2011-10-09 20:35:23
5554阅读
1点赞
java.lang.NoClassDefFoundError: org/hibernate/ejb/HibernatePersistence 缺少依赖包:hibernate-entitymanager.jar
转载 2017-06-01 09:22:00
150阅读
2评论
.
转载 2015-03-31 13:41:00
108阅读
2评论
<br />2011-3-16 0:09:26 org.apache.catalina.core.StandardWrap
原创 2022-09-12 01:19:22
98阅读
我这次异常的出现时,没有配置逐渐生成策略。
原创 2022-10-31 15:29:58
103阅读
我有一个JSF+spring+hibernate的项目,之前运行都是正常的,今天断网的情况下重启tomcat,发现程序无法运行了。主要报错是:java.lang.ExceptionInInitializerErrororg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySe
原创 2023-04-24 16:12:36
272阅读
两种情况,一种是有关键字不能解析某张表有version字段,从hibernate tools生成的hb
原创 2022-03-31 18:37:01
183阅读
这是因为Hibernate 4.x和5.x中的ServiceRegistry写法不同造成的Hibernate 4.x  //1.创建一个SessionFactory对象  SessionFactory sessionFactory=null;  //2.创建一个configuration对象,必须要根据你基本配置信息和映射关系 
原创 精选 2017-05-19 14:40:37
2922阅读
Hibernate版本5.2.9 获取Session的方式是sessionFactory.getCurrentSession(); 比较老一些的版本使用的是sessionFactory.openSession()是不管任何情况都重新开启一个Session。 从两者却别来说getCurrentSess
转载 2017-04-15 13:54:00
193阅读
2评论
org.hibernate.NonUniqueObjectException 异常处理
原创 2014-05-03 10:07:06
707阅读
org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1  原因
原创 2023-07-21 16:37:38
43阅读
代码如下: 报错如下: 错误解释: 大概的错误意思是: 游离态对象异常,对象引用了一个未保存的游离态对象,在保存对象之前请先保存游离态对象。 原因: 大概是新建的Role对象未调用save方法,所以该对象还是游离态,但是已经将该对象与user建立关联,所以在更新user的时候报错。 解决办法: 调用
原创 2021-07-15 10:53:18
173阅读
hibernate.org疑似被黑:访问hibernate.org都会被自动重定向到“[url]http://77.92.158.122/webmail/inc/web/index.php[/url]”这个页面的源代码如下:<script>window.location="";</script>大家可想而知会发生什么事了吧。
转载 精选 2009-04-17 10:11:40
258阅读
1评论
实体类继承BaseEntity时报错。解决方法:在属性或者get方法上加@Id@Id@GeneratedV
原创 2023-01-03 10:10:33
83阅读
项目之前在 Tomcat 环境下一直都正常运行,今天应客户要求需要迁移到 webLogic 10.3.6 下, 部署后竟然抛出了 org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken 异常,经过一番搜索后弄明白了问题的产生原因及解决方法。 问题原因 Hibernate3...
原创 2021-08-05 14:08:41
321阅读
Hibernate的Lazy初始化1:n关系时,必须保证是在同一个Session内部使用这个关系集合,不然Hiernate将抛出异常。 两种处理方法: 一、这是延时加载的问题,把有关联的所有pojo类,在hibernate.cfg.xml文件中。一般在many-to-one中,set标签内中设lazy="false" 。 二、用OpenSessionInViewFil
转载 精选 2013-02-21 17:09:08
490阅读
实体类继承BaseEntity时报错。解决方法:在属性或者get方法上加@Id@Id@GeneratedValue(strategy=GenerationType.AUTO)@Column(unique=true, nullable=false)public Long getId() {return
转载 2020-07-30 14:44:00
385阅读
2评论
 今天在用Hibernate的注解(@Entity)时出现了这么一个错误,一下就蒙了以前一直用没有出过错啊,仔细一看是包引错了,出错的包为 import org.hibernate.annotations.Entity  正确的包应该为 import javax.persistence.Entity  看到了吧,就差这么一点儿,以后可得看清
原创 2011-06-30 19:46:01
1627阅读
  • 1
  • 2
  • 3
  • 4
  • 5