My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
JavaAPI  
Java APIs
Java, API
Updated May 16, 2012 by l.garu...@gmail.com

Java APIs

OrientDB is written 100% in Java. You can use the native Java APIs without any driver or adapter.

Which library do I use?

OrientDB comes with some jar files contained in the lib directory

JAR name Description When required? Depends on 3rd party jars
orient-commons-.jarLibrary with some utility classes that are not part of OrientDB itself but usable with any kind of projectAlways
orientdb-core-.jarCore libraryAlways
orientdb-client-.jarRemote clientWhen your application talks with a remote server
orientdb-enterprise-.jarBase package with the protocol and network classes shared by client and serverWhen your application talks with a remote server
orientdb-server-.jarServer componentIt's used by the server component. Include it only if you're embedding a server
orientdb-tools-.jarContain the console and console commandsNever, unless you want to execute console command directly by your application. Used by the console application
orientdb-object-.jarContain the Object Database interfaceInclude it if you're using this interfacejavassist.jar, persistence-api-1.0.jar

First of all need to choose the database type to use by checking what you need:

JavaDoc

Browse the Orient DB API JavaDoc.

Database types

Type Use this if Description Java class Query Dictionary Schema Less Schema full Speed *
Object Database If you need a full Object Oriented abstraction that binds all the database entities to POJO (Plain Old Java Object)The higher level database. Able to store and retrieve POJOs transparently. Under the hood, it uses the Document Database to store object information. Can be used in schema-less or schema-based modes ODatabaseObjectTx Yes Yes Yes Yes 40%
TinkerPop Graph DatabaseIf you work with graphs and want your code portable across TinkerPop Blueprints implementationsThe bridge to use OrientDB with all TinkerPop technologies OrientGraph Yes Yes Yes Yes 45%
High-Level Graph DatabaseWill be deprecated in future releases. Use GraphDatabaseRaw or GraphDatabaseTinkerpop instead.The high level GraphDB API uses OGraphVertex and OGraphEdge classes.ODatabaseGraphTx Yes Yes Yes Yes 55%
Raw Graph DatabaseIf you work with graphs and need maximum performance.The lower level of GraphDB API. Directly uses ODocument objects.OGraphDatabase Yes Yes Yes Yes 70%
Document Databaseif you need high performance and/or work with schema-less structures.Handles records as documents. Documents are comprised of fields. Fields can be any of the types supported. Does not need a Java domain POJO, as required for the Object Database. Can be used as schema-less or schema-base modes ODatabaseDocumentTx Yes Yes Yes Yes 70%
Flat DatabaseIf you need maximum performance at the cost of having all records represented merely as StringsFlat record database that manages string contents. No Query capability at all, just direct access to records as stringsODatabaseFlat No Yes Yes No 100%

* Speed comparison for generic CRUD operations such as query, insertion, update and deletion. Larger is better. 100% is fastest. In general the price of a high level of abstraction is a speed penalty, but remember that Orient is orders of magnitude faster than the classic RDBMS. So using the Object Database gives you a high level of abstraction with much less code to develop and mantain.

Engines

OrientDB supports pluggable engines. The engine is the first part of the database URL. By default the "local" and "memory" are self-registered, while the "remote" requires to link the orient-client.jar library in your classpath.

Multi-threading

None of the database classes are thread-safe. For this reason use different Database instances in each thread. The local client cache is shared between all threads. When your client is connected to a remote OrientDB Server instance it is always best to work inside a transaction. In this way local changes will only be transmitted at commit time while transactions continue to see local changes. For more information: Multi Threading.

Schema APIs

If you are using a database that supports a schema (see the table above), check the Schema APIs page. Schema APIs are common to all databases that support this feature.

Hooks

Starting from v. 0.9.16 OrientDB supports hooks. Hook works like a trigger. Hook lets the user application intercept internal events. See Hook API.

Powered by Google Project Hosting