似乎你正在使用JDO [1]和PersistanceManager [2]。
就我所見,您嘗試執行的查詢可能是錯誤的。檢查如何使用JDO執行查詢[3]。
您所查詢的是:
String keywords[] = {"admin","drive","gmail","userinfo"};
Query query = pm.newQuery("SELECT scopes FROM com.cloudcodes.gcontrol.dataaccesslayer.insights.google.drive.GoogleInfo where :p.contains(scopes)");
result = (List) query.execute(Arrays.asList(keywords));
看起來你想要做的事,如:
//Query for all persons with lastName equal to Smith or Jones
Query q = pm.newQuery(Person.class, ":p.contains(lastName)");
q.execute(Arrays.asList("Smith", "Jones"));
Person.class is the kind
Arrays.asList("Smith", "Jones")
此參數 「:p.contains(lastName的)」 定義lastName的是我們想要的屬性檢查。 您正在將該類設置爲com.cloudcodes.gcontrol.dataaccesslayer.insights.google.drive.GoogleInfo,我想這是完整的Java名稱包,其中的類習慣是類名,而類名是GoogleInfo。所以你可以嘗試:
Query q = pm.newQuery(GoogleInfo.class, ":p.contains(scopes)");
q.execute(Arrays.asList("admin","drive","gmail","userinfo"));
你想檢索範圍。我假設你想使用REST API。所以在裏面:p.contains(「scopes」)可能會去與您想要檢索的實體中的keyWords相關的另一個屬性,也許是數組屬性?
在這裏,我與大家分享一些可能有用的文檔[4] [5]。
希望這會有所幫助!
[1] https://cloud.google.com/appengine/docs/standard/java/datastore/jdo/overview-dn2
[2] http://massapi.com/method/javax/jdo/PersistenceManager.newQuery-4.html
[3] https://cloud.google.com/appengine/docs/standard/java/datastore/jdo/queries
[4] https://cloud.google.com/datastore/docs/concepts/overview#comparison_with_traditional_databases
[5] https://cloud.google.com/datastore/docs/reference/gql_reference
來源
2017-12-19 15:16:24
JCJ