错误原因:

  new了一个新对象,在未保存之前将它保存进了一个新new的对象(也即不是持久态)。

解决办法:

  在保存或更新之前把这个对象查出来(这样就是一个持久态)

  <set name="proList" cascade="all">
     <key column="product_type"></key>
    <one-to-many class="cn.test.entity.Product"/>
  </set>

将cascade中的值设置为all就可以了

save the transient instance before flushing错误解决办法的更多相关文章

  1. save the transient instance before flushing错误解决办法 【待完善】

    近日在项目中遇到以下错误,着实郁闷了一把: org.hibernate.TransientObjectException: object references an unsaved transient ...

  2. object references an unsaved transient instance - save the transient instance before flushing错误

    异常1:not-null property references a null or transient value解决方法:将“一对多”关系中的“一”方,not-null设置为false(参考资料: ...

  3. object references an unsaved transient instance save the transient instance before flushing

    object references an unsaved transient instance save the transient instance before flushing 对象引用未保存的 ...

  4. org.unsaved transient instance - save the transient instance before flushing: bug解决方案

    最近开发和学习过程中,遇到很多零碎的知识点,在此简单地记录下: 1.遇如下bug: org.unsaved transient instance - save the transient instan ...

  5. ERROR org.hibernate.internal.SessionImpl - HHH000346: Error during managed flush [object references an unsaved transient instance - save the transient instance before flushing: cn.itcast.domain.Custom

    本片博文整理关于Hibernate中级联策略cascade和它导致的异常: Exception in thread "main" org.hibernate.TransientOb ...

  6. object references an unsaved transient instance - save the transient instance before flushing异常问题处理

    一.异常:org.hibernate.TransientObjectException: object references an unsaved transient instance - save ...

  7. object references an unsaved transient instance - save the transient instance before flushing: com.jspxcms.core.domain.ScTeam

    object references an unsaved transient instance - save the transient instance before flushing: com.j ...

  8. hibernate 对象状态异常:object references an unsaved transient instance - save the transient instance before flushing

    我的问题出在,删除的对象对应的表中有一个外键,关联着另外一个表,可是另外一个表中没有数据,所以报了这个错误. 参考http://www.cnblogs.com/onlywujun/archive/20 ...

  9. MySQL之Field‘***’doesn’t have a default value错误解决办法

    这篇文章主要介绍了MySQL之Field‘***’doesn’t have a default value错误解决办法,需要的朋友可以参考下 今天,中国博客联盟有博友反馈,zgboke.com无法提交 ...

随机推荐

  1. 模仿.NET框架ArrayList写一个自己的动态数组类MyArrayList,揭示foreach实现原理

    通过.NET反编译工具可以查看到ArrayList内部的代码,发现ArrayList并非由链表实现,而是由一个不断扩容的数组对象组成. 下面模仿ArrayList写一个自己的MyArrayList. ...

  2. POJ2516 Minimum Cost

    亲爱的,一个货物销售者,现在遇到了一个大问题,他需要你的帮助.在他的销售区域有 N 个店主(从 1 到 N)向他储存货物,Dearboy 有M 个供应点(从 1 到 M),每个供应点提供 K 种不同的 ...

  3. BUG搬运工:CSCvp31778-3802 apsw_watchdog: WARNING: System memory is running low

    如下bug主要针对Cisco COS AP比如18.28.38... 主要现象: AP上连关联的终端显示的是信号满格,但是无法访问内网,所有的终端都这样,只有重启AP后才可以解决. 频率: 这种现象有 ...

  4. Linux 下忘记mysql 密码

    ERROR (): Access denied for user 'root'@'localhost' (using password: YES). 一.停止 mysql 数据库 /etc/init. ...

  5. 【转】使用shell登录远程服务器执行多条命令,ssh登录之后执行脚本文件

    原文:https://blog.csdn.net/qq_36622490/article/details/100773589 这个需求主要是我在jenkins中pipeline的代码里,需要使用she ...

  6. 后端——框架——持久层框架——Mybatis——《Mybatis从入门到精通》读书笔记——初篇

    1.Mybatis知识点 框架的知识点大致可以分为三个部分 基础: 介绍编写增,删,改,查: 动态标签: config配置文件 Mapper配置文件 插件:常见的插件有三个 pageHelper:分页 ...

  7. web优化(一 前端)

    当我们在浏览器地址栏中输入一个URL的时候,网页开始请求,我们在页面上看到的内容就是许多个HTTP请求从服务器返回的数据展示,这些展示的快慢很大程度依赖前端的优化,怎样做好前端的优化,我这里总结了几点 ...

  8. word2vec词向量处理中文语料

    word2vec介绍 word2vec官网:https://code.google.com/p/word2vec/ word2vec是google的一个开源工具,能够根据输入的词的集合计算出词与词之间 ...

  9. 怎么修改Anaconda 中 jupyter notebook 文件的保存位置

    安装完 anaconda ,在jupyter notebook 中创建的文件的默认保存位置为C:\User\电脑名 修改保存位置 1.打开 anaconda prompt 2.输入 jupyter n ...

  10. Navigating to current location ("/") is not allowed

    main.js import Router from 'vue-router' // 这个是为了避免一个报错 const originalPush = Router.prototype.push; R ...