[英]Preserve arbitrary order in a collection defined with JDO in Google App Engine
[英]Google App Engine - JDO - How to update collection?
嘗試使用JDO更新集合中的一個對象時遇到問題。
這是事實:
一些相關的代碼:
Query q = pm.newQuery(BigClass.class,"id==:ids");
List<BigClass> participatingUsers=(List<BigClass>)
q.execute(participantIDs);
//Update the participants
ListIterator<BigClass> it=participatingUsers.listIterator();
BigClass participant;
boolean modified;
while(it.hasNext())
{
participant=it.next();
participant.list.remove(smth);
JDOHelper.makeDirty(participant,"collection");
}
....
modify other objects
....
pm.close()
另一件事是,我保留了本部分之后所做的一些更改...
因此,如果您有任何建議,請射擊!
波斯菊
您可能需要致電pm.makePersistent(participant);
在從list
刪除smth
后繼續更改。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.