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

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

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学习点滴——Integer缓存

    前言 一切从下面这段代码开始 public static void test(String[] agrs){ Integer a = 1; Integer b = 2; System.out.prin ...

  2. C++系列总结——继承

    前言 前面讲了封装,但封装只是隐藏了类内部实现.如果使用多态隐藏类本身的话,只有封装是不够的,还需要继承. 继承 通过封装.我们把一些相关的函数和变量包裹在了一起,这些函数和变量就叫做类的成员函数和成 ...

  3. Java基础小知识笔记

    1. Integer转进制的一个类2. toBinaryString,toOctalString,toHexString.(转为二进制,八进制,十六进制的方法)3. 如果·数据的大小没有超过byte/ ...

  4. ecstore中怎样使用ajax提交数据

    //javascript代码 $$(".bb").addEvent('change',function(e){ var order_item_id = this.get('orde ...

  5. HandlerThread原理分析

    HandlerThread是一个内部拥有Handler和Looper的特殊Thread,可以方便地在子线程中处理消息. 简单使用 HandlerThread的使用比较简单. mHandlerThrea ...

  6. 【English】八、食物相关

    一.beer.wine.coffee.soup.oil.juice beer 啤酒 They drink beer. wine 葡萄酒 Wine and coffee. coffee 咖啡 Wine ...

  7. SQL ----post漏洞测试注入

    使用工具sqlmap 输入账号密码进行bp截断,获取文本保存在sqlmap下面2.txt 爆数据库 爆表爆表 爆数据 最后把数据密码md5解析

  8. Nginx-Linux下安装

    Nginx一般用来做反向代理,实现负载均衡.由于Nginx是用c开发的,所以安装前我们需要安装相应的环境,比如gcc等.下面是本人安装操作的步骤: step1.安装gcc:yum install gc ...

  9. 【Spring Cloud笔记】Eureka注册中心增加权限认证

    在Spring Cloud通过Eureka实现服务注册与发现时,默认提供web管理界面,但是如果在生产环境暴露出来,会存在安全问题.为了解决这个问题,我们可以通过添加权限认证进行控制,具体步骤如下: ...

  10. VS code 中的各种变量 ${file},${fileBasename}

    VS code 中的各种变量 ${file},${fileBasename} 2017年08月24日 11:14:07 bailsong 阅读数:7108    from: https://blog. ...