2

I am using orientdb 2.1.4. I have a class(Vertex) ParentV which has subclass(Vertex) ChildV.

When I query the database using getVertices("ParentV", new String[]{key}, new Object[]{value}), no results of "ChildV" type are found.

Could anyone let me know how to enable polymorphic search in above function because I need all the results(including parent and child classes) where given key matches given value.

Note: I can't use any other getVertices function because there are cases with multiple key and values. These functions are provided by tinkerpop blueprints APIs.

Ashish
  • 31
  • 3
  • Looking the signature of the method getVertices, I think that you can use g.getVertices("ParentV",true) and after you can filter on the key – Alessandro Rota Dec 24 '15 at 16:01
  • Thanks Alessandro. But that would make the search slow if number of records are huge and only one record matches the key. – Ashish Dec 28 '15 at 06:15
  • You are right. Alternatively, you can combine the results of the following instructions 1) g.getVertices("ParentV", key,object); 2) g.getVertices("ChildV", key,object); – Alessandro Rota Dec 28 '15 at 16:27

0 Answers0