我正在尝试使用键列表和参考键来查询对象,如下所示:
//s is a datastore key
Query q2 = pm.newQuery(Stream_Result.class,":p.contains(key) && stream == " + KeyFactory.keyToString(s));
ArrayList<List<Stream_Result> stream_r_list = (List<Stream_Result>) q2.execute(Arrays.asList(cr.getStreamResults().toArray()))
在引入带有字符“ - ”的键之前,它可以正常工作。 如果s是像ag1zfmVkaW5zdHV0aW9ucg4LEgZTdHJlYW0Y那样的东西那么它执行得很好。但是,如果密钥类似于ag1zfmVkaW5zdHV0aW9ucg4LEgZTdHJlYW0Y-dIBDA,我会得到一个例外:
org.datanucleus.store.appengine.query.DatastoreQuery$UnsupportedDatastoreFeatureException:
Right side of expression is composed of unsupported components. Left: org.datanucleus.query.expression.VariableExpression, Op: - , Right: VariableExpression{dIBDA}
我该如何解决这个问题?