ODatabaseDocumentTx db = new ODatabaseDocumentTx("local:/tmp/db");
OFunction sum = db.getMetadata().getFunctionLibrary().getFunction("sum");
Number result = sum.execute(3, 5);
Can you please explain the last line? How can a Number variable refer to an Object instance? It might be so that I am mistaken grossly somewhere.
I also find that we might be able to write a Java function in Orientdb provided we connect that with the SQL Engine. Is there a way to use OFunction object (in a similar way as for JS functions), instead of SQL query shooting, to execute the function?