由于前台提交的对象,并没有关联对象的数据。

所以要把关联对象赋值一下,在合并集合。

WmsOutboundreport entity2 = service.findOne(item.getOutboundOrderUUID());
//关联对象赋值一下
item.setOutboundOrderUUID(entity2.getOutboundOrderUUID());
item.setOutbound(entity2.getOutbound());
item.setOutboundOrderDetailUUID(entity2.getOutboundOrderDetailUUID());
item.setDetail(entity2.getDetail());
//合并方法
DozerMapperUtil.map(item, entity2);
entity2.setUpdateTime(new Date());
entity2.setUpdateUserUUID(curUser.getUpdateUserUUId());
service.save(entity2);

网上有说,先清除后保存

dao.clear();

dao.save();

JPA:identifier of an instance of was altered from的更多相关文章

  1. identifier of an instance of **** was altered from **** to *****

    在用hibernate getSession().save(entity)方法保存数据库表实体类的时候报这个异常 我的需求是一个请求要往数据库表插两条数据,根据传值判断做了for循环调两次save() ...

  2. 解决org.hibernate.HibernateException: identifier of an instance of com.ahd.entity.Order was altered from2 to 0

    错误信息 严重: Servlet.service() for servlet [springmvc] in context with path [/order] threw exception [Re ...

  3. 【hibernate】错误:org.hibernate.HibernateException: identifier of an instance of com.agen.entity.Monthdetail was altered from xx to xx

    所报错误: org.hibernate.HibernateException: identifier of an instance of com.agen.entity.Monthdetail was ...

  4. identifier of an instance of com.xxx.model.system.xxxObject was altered from 1765 to 1766

    Caused by: org.hibernate.HibernateException: identifier of an instance of com.xxx.model.system.xxxOb ...

  5. identifier of an instance of xx.entity was altered from xxKey@249e3cb2 to xxKey@74e8f4a3; nested exception is org.hibernate.HibernateException: identifier of an instance of xxentity was altered from错误

    用entityManager保存数据时报错如下 identifier of an instance of xx.entity was altered from xxKey@249e3cb2 to xx ...

  6. 161117、使用spring声明式事务抛出 identifier of an instance of

    今天项目组有成员使用spring声明式事务出现下面异常,这里跟大家分享学习下. 异常信息: org.springframework.orm.hibernate3.HibernateSystemExce ...

  7. Caused by: org.hibernate.HibernateException: identifier of an instance of ... is alterde from

    Caused by: org.hibernate.HibernateException: identifier of an instance of ... is alterde from     Hi ...

  8. Hibernate异常:identifier of an instance of 错误

    今天写项目时,在使用hibernate封装的插入方法时,由于需要同时保存多个数据,导致出现identifier of an instance of 如下代码 :(由于最大最小分数不同所以需要插入两条数 ...

  9. 从一次异常中浅谈Hibernate的flush机制

    摘自http://www.niwozhi.net/demo_c70_i1482.html http://blog.itpub.net/1586/viewspace-829613/ 这是在一次事务提交时 ...

随机推荐

  1. 用于ViEmu的重置为试用状态的Python脚本

    import winreg import shutil shutil.rmtree("C:\\Users\\Administrator\\AppData\\Local\\Identities ...

  2. C# 构造tree菜单工具方法

    如何构造tree数据结构,做个笔记,方便查阅,本方法是直接返回json字符串: private string ToMenuJson(List<Model> data, string par ...

  3. 常用vi编辑器命令行

    游标控制: h 游标向左移 j 游标向下移 k 游标向上移 l(or spacebar) 游标向右移 w 向前移动一个单词 b 向后移动一个单词 e 向前移动一个单词,且游标指向单词的末尾 ( 移到当 ...

  4. OPP的三大特征之封装总结

    '''封装: 1.什么是封装? 封装是把什么东西装到容器中,再封闭起来 与隐藏有相似之处,但不是单纯的隐藏 官方解释:封装是指对外部隐藏实现细节,并提供简单的使用接口 封装的好处: 1.提高安全性 2 ...

  5. 中文代码示例之5分钟入门TypeScript

    "中文编程"知乎专栏原文 Typescript官方文档起的这个噱头名字: TypeScript in 5 minutes, 虽然光看完文章就不止5分钟...走完整个文档流水账如下( ...

  6. C++一种高精度计时器

    在windows下可以通过QueryPerformanceFrequency()和QueryPerformanceCounter()等系列函数来实现计时器的功能. 根据其函数说明,其精度能够达到微秒级 ...

  7. 【设计模式】组合模式 Composite Pattern

    树形结构是软件行业很常见的一种结构,几乎随处可见,  比如: HTML 页面中的DOM,产品的分类,通常一些应用或网站的菜单,Windows Form 中的控件继承关系,Android中的View继承 ...

  8. MQTT简单介绍与实现

    1. MQTT 介绍它是一种 机器之间通讯 machine-to-machine (M2M).物联网 Internet of Things (IoT)常用的一种轻量级消息传输协议适用于网络带宽较低的场 ...

  9. SQL语句将一个表的数据写入到另一个表中

    在日常的数据库运维过程中,有时候需要将Select查询出来的数据集写入到另一个数据表中,其中一种方式是通过存储过程循环写入数据,另一种简便的方式是直接使用Insert Into语句后面跟上Select ...

  10. js 倒计时跳转

    用js实现简单的倒计时结束页面跳转效果,主要用到setInterval()和clearInterval()方法,页面跳转使用window.location.href = " ".倒 ...