2010-10-08 92 views
0

我需要通過設置爲用戶實體的Id的用戶密鑰來獲取實體。現在我想查詢與用戶具有相同密鑰的所有實體。我怎樣才能做到這一點?在Google App Engine中按鍵查詢?

+1

問題不清楚。密鑰應該是唯一的值,所以你只能得到給定密鑰的一個值。 – 2010-10-08 19:41:46

回答

0

歐凱,現在我發現自己的解決方案:

Query query = pm.newQuery(Entity.class, "user == userParam"); 
      query.declareParameters("com.google.appengine.api.datastore.Key userParam");