JPA:identifier of an instance of was altered from

Posted hanjun0612

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JPA:identifier of an instance of was altered from相关的知识,希望对你有一定的参考价值。

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

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

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的主要内容,如果未能解决你的问题,请参考以下文章

ios 10 如何使用preferredFocusEnvironments insted of preferredFocusedView?

Unchase OpenAPI (Swagger) Connected Service : 请求的参数设置为 Dictionary<string, string> insted of ID

The JVM found at JAVA_HOME is damaged.Please reinstall or define EXE4J_JAVA_HOME to point to an inst

Reverse digits of an integer.

LeetCode Degree of an Array

An Example of SignalR