@Test public void testReqQuery_forEach_arr_points_into_ref() throws Exception { GMD gmd = new GMD(projection("{'field':'us','include':1}"), null); CompositeMetadata md = CompositeMetadata.buildCompositeMetadata(getMd("composite/L.json"), gmd); AnalyzeQuery pq = new AnalyzeQuery(md, null); QueryExpression q = query("{'array':'us.*.authentications','elemMatch':{ '$and':[ { 'field':'principal','op':'$in','values':['a']}, {'field':'providerName','op':'$eq','rvalue':'p'} ] } }"); pq.iterate(q); List<QueryFieldInfo> list = pq.getFieldInfo(); RewriteQuery rw = new RewriteQuery(md, md.getChildMetadata(new Path("us"))); RewriteQuery.RewriteQueryResult result = rw.rewriteQuery(q, list); QueryExpression newq = result.query; System.out.println(newq); List<BoundObject> bindings = result.bindings; Assert.assertEquals("authentications", ((ArrayMatchExpression) newq).getArray().toString()); rw = new RewriteQuery(md, md); result = rw.rewriteQuery(q, list); bindings = result.bindings; newq = result.query; System.out.println(newq); Assert.assertTrue(newq instanceof RewriteQuery.TruePH); }
public RewriteQuery(CompositeMetadata root, CompositeMetadata currentEntity) { this.currentEntity = currentEntity; }
RewriteQuery extends QueryIterator { public RewriteQuery(CompositeMetadata root, CompositeMetadata currentEntity) { this.currentEntity = currentEntity; } }
RewriteQuery extends QueryIterator { public RewriteQuery(CompositeMetadata root, CompositeMetadata currentEntity) { this.currentEntity = currentEntity; } RewriteQuery(CompositeMetadata root,
                        CompositeMetadata currentEntity); }
RewriteQuery extends QueryIterator { public RewriteQuery(CompositeMetadata root, CompositeMetadata currentEntity) { this.currentEntity = currentEntity; } RewriteQuery(CompositeMetadata root,
                        CompositeMetadata currentEntity); RewriteQueryResult rewriteQuery(QueryExpression q, List<QueryFieldInfo> fieldInfo); }
RewriteQuery extends QueryIterator { public RewriteQuery(CompositeMetadata root, CompositeMetadata currentEntity) { this.currentEntity = currentEntity; } RewriteQuery(CompositeMetadata root,
                        CompositeMetadata currentEntity); RewriteQueryResult rewriteQuery(QueryExpression q, List<QueryFieldInfo> fieldInfo);  }