What you say make a lot of sense, but I'm not sure it work in this case.

I am creating a Dynamic Hook 
- http://orientdb.com/docs/last/Dynamic-Hooks.html

I have created a Java static method to respond to the Hook. As far as I can 
determine the method must have a function signature of a single ODocument 
object. (From the ODocument I can call doc.getDatabase() to get the 
ODatabase, but I cannot get the OrientGraph.)

public static void fireMyEvent(final ODocument doc) {

   ....

}


Is there a different way to define the static method?


On Monday, March 7, 2016 at 3:35:05 PM UTC-8, kurtuluş yılmaz wrote:
>
> Hi Rob;
> You can use both document and graph at same db. or over orientgraph so you 
> don't need to change your connection. Graph api is more sophisticated  api 
> then document api. You can do what you want at document api, at graph api. 
>  For try just call save method of ODocument  and orientGraph.addVertex(); 
> methods and after call orientGraph.commit(). 
>
>
> OrientGraph orientGraph = new OrientGraph(database.getURL());
> Vertex vert = orientGraph.addVertex();
>
> ODocument document = new ODocument();
>
> document.setClassName("example");
>
> orientGraph.commit();
>
> 8 Mart 2016 Salı 01:17:52 UTC+2 tarihinde Rob Smith yazdı:
>>
>> I have an ODatabase object (database), and I want to do something using 
>> the GraphAPI. Is this a good approach? Is there something better?
>>
>>         OrientGraph orientGraph = new OrientGraph(database.getURL());
>>         orientGraph.getRawGraph().activateOnCurrentThread();
>>
>>         Vertex vert = orientGraph.addVertex();
>>         ...
>>
>>         orientGraph.commit();
>>
>>         // return 'database' to active
>>         database.activateOnCurrentThread();
>>
>>
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to