Can Graph API and Object API be used together (OObjectDatabaseTx and OrientGraphFactory) ?

152 views
Skip to first unread message

Newbee to OrientDB

unread,
Apr 25, 2015, 11:38:30 AM4/25/15
to orient-...@googlegroups.com
I'm trying to create a starter OrientDB project using Spring and ObjectQuery-orientDB but I'm having trouble understanding the relationship between  OObjectDatabaseTx and OrientGraphFactory and how should I go about setting my project. I usually use Hibernate or Spring data to query & modify the database. 

Is it a good practice to use them both (OObjectDatabaseTx and OrientGraphFactory) in a same project for a same Graph database ?

I was thinking of using the OObjectDatabaseTx class to do Select and Update operation on the Vertices and Edges. 
Eg: update Customer name, email etc
and use Objectquery-orientdb library for query operations. This library only uses OObjectDatabaseTx to generate queries.

Is having connections defined as following as Spring configuration beans a good practice ?  
OrientGraphFactory graphFactoryBean = new OrientGraphFactory("remote:database", "root", "root");
OObjectDatabaseTx objectDatabaseBean = new OObjectDatabaseTx("remote:localhost/database").open("root", "root"); 

Does this mean that my application will have two different connections to the database ?

Newbee to OrientDB

unread,
Apr 25, 2015, 11:58:26 AM4/25/15
to orient-...@googlegroups.com
If this is not a good practice to use OObjectDatabaseTx with  OrientGraphFactory together .. then what is the right architecture to do CRUD operations to OrientDB's graph database and binding the results to POJOs instead of dealing with JSON strings ? 

Simer P

unread,
Apr 26, 2015, 10:08:10 AM4/26/15
to orient-...@googlegroups.com
Guys, please help 

Luca Garulli

unread,
May 4, 2015, 5:26:13 AM5/4/15
to orient-...@googlegroups.com
Object and Graph API don't work well together. Instead you can use Graph and Document or Object and Document. If you use Object API it's better to rely to uni-directional edges (links) rather then bidirectional edges.

Why can't you use Graph API?

Best Regards,

Luca Garulli
CEO at Orient Technologies LTD
the Company behind OrientDB


On 26 April 2015 at 16:08, Simer P <sim...@gmail.com> wrote:
Guys, please help 

On Sun, Apr 26, 2015 at 1:58 AM, Newbee to OrientDB <sim...@gmail.com> wrote:
If this is not a good practice to use OObjectDatabaseTx with  OrientGraphFactory together .. then what is the right architecture to do CRUD operations to OrientDB's graph database and binding the results to POJOs instead of dealing with JSON strings ? 

--

---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/x7xPhMOk3Pc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--

---
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 orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Newbee to OrientDB

unread,
May 4, 2015, 5:43:26 AM5/4/15
to orient-...@googlegroups.com
The reason I was thinking of using Graph API with Object API is because Object API offers JPA/ORM like capabilities so we can switch to Graph API when we need graph like operations (Traverse etc) and use Object API non Graph operations like creating Vertexes without Edges and SQL querying.

You said Object and Graph API don't work well together .. will Document API give us JPA/ORM like capabilities ?    
 
   
Reply all
Reply to author
Forward
0 new messages