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

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

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. Java设计模式系列-工厂方法模式

    原创文章,转载请标注出处:<Java设计模式系列-工厂方法模式> 一.概述 工厂,就是生产产品的地方. 在Java设计模式中使用工厂的概念,那就是生成对象的地方了. 本来直接就能创建的对象 ...

  2. celery异步消息处理框架

    Celery 1.什么是Clelery Celery是一个简单.灵活且可靠的,处理大量消息的分布式系统 专注于实时处理的异步任务队列 同时也支持任务调度 Celery架构 Celery的架构由三部分组 ...

  3. 菜鸟先飞C#学习总结(一)

    一.第一个程序Hellow Word using System; //using 关键字用于在程序中包含 System 命名空间. 一个程序一般有多个 using 语句. using System.C ...

  4. Kail Linux的安装方法

    众所周知,kail 是一个基于Debian的Linux发行版,它的目标就是为了在一个实用的工具包里尽可能多的包含渗透和审计工具 kail就实现了这个目标,里面包含有很多关于安全测试的开源工具,如果现在 ...

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

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

  6. java压缩指定目录下的所有文件和文件夹的代码

    将代码过程较好的代码段备份一下,下边资料是关于java压缩指定目录下的所有文件和文件夹的代码,希望对码农有帮助. String sourceDir="E:\test";int pa ...

  7. 工具资源系列之给mac装个虚拟机

    mac 系统安装虚拟机目前有两种主流软件,一种是 Parallels Desktop ,另一种是 vmware. 本教程选用的是 vmware ,因为我之前 windows 上安装的虚拟机软件就是vm ...

  8. simulink创建简单模型

    创建简单模型 您可以使用 Simulink® 对系统建模,然后仿真该系统的动态行为.Simulink 允许您创建模块图,图中的各个连接模块代表系统的各个部分,信号代表这些模块之间的输入/输出关系.Si ...

  9. PMP(第六版)十大知识领域、五大项目管理过程组、49个过程矩阵

    今天整理了PMP(第六版)十大知识领域.五大项目管理过程组.49个过程矩阵,分享出来,希望对要考PMP的童鞋有帮助. PS.红字是与第五版的差异 转走请标明出处  https://www.cnblog ...

  10. SQL 知道字段名 全表搜索此字段属于哪个表

    SELECT name FROM sysobjects WHERE id IN (SELECT ID FROM syscolumns WHERE name='字段名')