有什么方法可以在JDO中使用瞬态对象进行更新? [英] Is there any way to update using a transient object in JDO?

查看:78
本文介绍了有什么方法可以在JDO中使用瞬态对象进行更新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用处于瞬态状态的对象并在Google App Engine数据存储区中进行更新时,其更新操作可以完美运行,但是当使用同一对象在MySQL中进行更新时,由于状态为瞬态,它将创建一个新对象.

When using an object in transient state and updating in Google App Engine Datastore, it's update operation works perfectly, but when using the same object to update it in MySQL, it is creating a new object as the state is transient.

所以我想问,当状态为瞬态时,有什么方法可以更新数据?

So I wanted to ask, is there any way to update a data when the state is transient?

我正在使用Datanucleus JDO和Google App Engine java条纹.

I am using Datanucleus JDO and Google App Engine, java ,stripes.

推荐答案

否.它是TRANSIENT,而不是DETACHED.如果您确实愿意,可以将字段复制到MANAGED对象.但是,那么DETACHED状态的全部要点是您将要对其进行修改然后附加它,这与TRANSIENT不同

No. It is TRANSIENT, as opposed to DETACHED. You could copy the fields across to a MANAGED object if you really wanted to. But then the whole point of DETACHED state is that you will be modifying it and then ATTACHING it, unlike a TRANSIENT

这篇关于有什么方法可以在JDO中使用瞬态对象进行更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆