Closed sombra-ostryzhniuk-andrii closed 4 years ago
Hi @sombra-ostryzhniuk-andrii
Do you have the traversal that fails? Thanks
@wolf4ood Do you mean a stack trace?
Hi @sombra-ostryzhniuk-andrii
I mean the gremlin traversal/query that produces this error
@wolf4ood
No, I don't have. I use this spring data query:
Optional<GenericContainer> findByDefinitionAndDeleted(String definition, Boolean deleted);
Which spring data?
Do you have a reproducer that I can use to debug it ?
Thanks
Do you mean something like this?
DefaultGraphTraversal : [OrientGraphStep(vertex,[~label.eq(GenericContainer), definition.eq(test), ~label.eq(GenericContainer), deleted.eq(false)])]
That's the value from OrientGraphCountStrategy : apply(Traversal.Admin<?, ?> traversal)
.
definition
and deleted
are properties. That error occurs for every query by two or more parameters, independently on data.
Thanks
Hi @sombra-ostryzhniuk-andrii
thanks for the debug info, i guess spring data gremlin you are referring to.
I guess that filter put the labels 2 times and make the ODB builder fails.
Your patch is correct , i will applying it and it will be available in the next release or snapshot
Thanks
Queries with two or more parameters don't work. For example:
Optional<GenericContainer> findByDefinitionAndDeleted(String definition, Boolean deleted);
The reason: The same entity class is added each time for each parameter so then the same query are generated two times, for each item of theclasses
list. So an error occurs:Possible solution: Allow only unique values in the
classes
list in the classorg/apache/tinkerpop/gremlin/orientdb/OrientGraphQueryBuilder.java
: