OrientDB: How to return plugins results?

51 Views Asked by At

I have create a java-function that return the full path between two OElement but I do not found the correct way to return it results. Actually it collect all the path in ArraList<ArrayList> but it is not shown in the Studio. I suppose that I should use something like OResultSet but I don't found anythig about its.

Example: enter image description here

I implemented this: fullpath(from, to, maxDepth, conditions)

select fullPath(#58:0, #65:0)  
n1,path_1,n2_1,path_1,n3_1,path_1,n4
n1,path_2,n2_3,path_1,n4
n1,path_1,n2_2,path_1,n3_2,path_1,n4
n1,path_1,n2_2,path_2,n3_3,path_1,n4_1,path_2,n3_2,path_1,n4

and I'am working on this:

select fullPath(n1, n4, 100, include(path_1))  
n1,path_1,n2_1,path_1,n3_1,path_1,n4
n1,path_1,n2_2,path_1,n3_2,path_1,n4

The code is here: fullPath on github

Thanks.

2

There are 2 best solutions below

1
On

I think the main problem here is that the result of the function is being returned as a single result, so Studio cannot manage it.

As a first attempt, I'd try to do a

SELECT expand(fullPath(...)) 

This will definitely work in the tabular view in Studio, but it will still not display in the GRAPH view.

For the GRAPH view, my suggestion is to put all the RIDs in a single ArrayList and then do the expand()

0
On

With ArraList<ArrayList> did not work, but an ArrayList<OIdentifiable[ ] > did the job.