2013-05-08 53 views
0
Key newwordKey = KeyFactory.createKey(NEWWORD_KEY_KIND, NEWWORD_KEY); 
Entity newWord = new Entity(NEWWORD_ENTITY_KIND, newwordKey); 
newWord.setProperty(USER_COL_USERNAME, userName); 
newWord.setProperty(NEWWORD_COL, word); 
datastore.put(newWord); 

我的意思是我想它的財產「用戶名」 防爆刪除所有「newword」實體,刪除用戶「亞歷克西斯」 任何想法,上傳所有的話嗎? THX如何通過財產GAE數據存儲中刪除一個實體

回答

1

使用delete 3520查詢功能:

Query q = pm.newQuery(NEWWORD_KIND.class); 
q.setFilter("USER_COL_USERNAME == USR"); 
q.declareParameters("String USR"); 
q.deletePersistentAll("Alexis"); 

More info here

希望這有助於。

+0

Thx,它的工作原理。 :d – Alexis 2013-05-10 01:23:00

相關問題