Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

userSuppliedId multiple has clauses breaks #344

Closed
pietermartin opened this issue Mar 27, 2019 · 0 comments
Closed

userSuppliedId multiple has clauses breaks #344

pietermartin opened this issue Mar 27, 2019 · 0 comments
Assignees
Labels

Comments

@pietermartin
Copy link
Owner

        this.sqlgGraph.getTopology().getPublicSchema().ensureVertexLabelExist(
                "TestHierarchy",
                new LinkedHashMap<String, PropertyType>() {{
                    put("column1", PropertyType.STRING);
                    put("column2", PropertyType.STRING);
                    put("name", PropertyType.STRING);
                }},
                ListOrderedSet.listOrderedSet(Arrays.asList("column1", "column2"))
        );
        this.sqlgGraph.tx().commit();
        this.sqlgGraph.addVertex(T.label, "TestHierarchy", "column1", "a1", "column2", "a2", "name", "name1");
        this.sqlgGraph.addVertex(T.label, "TestHierarchy", "column1", "b1", "column2", "b2", "name", "name1");
        this.sqlgGraph.addVertex(T.label, "TestHierarchy", "column1", "c1", "column2", "c2", "name", "name1");
        this.sqlgGraph.addVertex(T.label, "TestHierarchy", "column1", "d1", "column2", "d2", "name", "name1");
        this.sqlgGraph.tx().commit();

        List<String> values1 = Collections.singletonList("");
        List<String> values2 = Collections.singletonList("");
        List<Vertex> vertexList = this.sqlgGraph.traversal().V()
                .hasLabel("TestHierarchy")
                .has("column1", P.within(values1))
                .has("column2", P.within(values2))
                .toList();
        Assert.assertEquals(0, vertexList.size());

        values1 = Arrays.asList("a1", "b1", "c1");
        values2 = Arrays.asList("a2", "b2", "c2");

        vertexList = this.sqlgGraph.traversal().V()
                .hasLabel("TestHierarchy")
                .has("column1", P.within(values1))
                .has("column2", P.within(values2))
                .toList();
        Assert.assertEquals(3, vertexList.size());

Above queries breaks. The where clause is not being set correctly.

@pietermartin pietermartin self-assigned this Mar 27, 2019
pietermartin pushed a commit that referenced this issue Mar 28, 2019
Correct incorrect logic for generating where clauses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant