wisdom-orientdb-document

Provide a service that allows for the configuration and use of the OrientDB document api.

License

License

GroupId

GroupId

org.wisdom-framework
ArtifactId

ArtifactId

wisdom-orientdb-document
Last Version

Last Version

0.3.0
Release Date

Release Date

Type

Type

wisdom
Description

Description

wisdom-orientdb-document
Provide a service that allows for the configuration and use of the OrientDB document api.

Download wisdom-orientdb-document

Dependencies

compile (10)

Group / Artifact Type Version
org.wisdom-framework : wisdom-api jar 0.9.1
org.apache.felix : org.apache.felix.ipojo.annotations jar
org.slf4j : slf4j-api jar 1.7.12
org.wisdom-framework : wisdom-orientdb-manager jar 0.3.0
com.orientechnologies : orientdb-core jar 2.1.2
com.orientechnologies : orientdb-client jar 2.1.2
junit : junit jar
org.assertj : assertj-core jar
org.mockito : mockito-all jar
org.fluentlenium : fluentlenium-assertj jar

test (2)

Group / Artifact Type Version
org.wisdom-framework : wisdom-test jar 0.9.1
org.slf4j : slf4j-jcl jar 1.7.12

Project Modules

There are no modules declared in this project.

Wisdom-OrientDB Build Status Coverity Scan Build Status Dependency Status

OrientDB is an open source NoSQL DBMS. It is fully written in Java. While it's a Document Database, it also has Graph and Object database features and API.

Wisdom-OrientDB brings OrientDB to your wisdom framework projects.

The wisdom-orientdb-object project provides an implementation of the Crud service; wrapping the object database features of OrientDB.

Set Up

In order to use wisdom-orientdb-object within your wisdom project, you must follow two steps.

The first is to add it's dependency in your pom.xml.

<dependency>
  <groupId>org.wisdom-framework</groupId>
  <artifactId>wisdom-orientdb-object</artifactId>
  <version>${release.version}</version>
</dependency>

The second step is to configure your OrientDB database in wisdom application.conf

orientdb.test.url="memory:todolist"
orientdb.test.user="test"
orientdb.test.pass="test"
orientdb.test.package="todolist.model"

The example above shows how to set up an orientdb database with an alias test. The orientdb.test.package is the name of the package that contains your entities.

Bellows are the optional properties that allows for a more tailored configuration

  • orientdb.<alias>.autolazyloading = boolean property, a convenient way to configure the default orientDB lazy loading behavior (default is true).
  • orientdb.<alias>.txtype = OTransaction.TXTYPE property | the default transaction type (TXTYPE.OPTIMISTIC by default).
  • orientdb.<alias>.poolmin = integer property, the minimun value of the database connection pool (1 by default).
  • orientdb.<alias>.poolmax = integer property, the minimun value of the database connection pool (20 by default).

Alternative

As an alternative you can set up your OrientDB model by providing an OrientDbRepoCommand service.

    WOrientConf getConf();
    List<Class<?>> getEntityClass();
    void init(OObjectDatabaseTx db);
    void destroy(OObjectDatabaseTx db);

The service implementation must contain the configuration and the entities class list. The init and destroy callback are hook that allows for: registering and de-registering your entities, as well as manage evolution.

Usage

Once wisdom-orientDB has been properly set up you can now requires either wisdom Crud services or the specialized OrientDbCrud for each of the entity available in your model package.

The following example illustrates how to inject an OrientDBCrud service for the entity Todo.class. An entity is a java class annotated with javax.persistence.Entity.

@Model(value = Todo.class)
private OrientDbCrud<Todo,String> todoCrud;

More information about the behavior of the OrientDB database is available on their wiki.

Troubleshooting

OrientDB uses javassist in order to create proxy for the entity object. This can cause your project to experience some problems when being dynamicaly updated if it does not have javassist.util.proxy.Proxy in its classpath. A work around is to load this class in one of your component.

import javassist.util.proxy.Proxy;
//...
static {Class workaround = Proxy.class;}
//...
org.wisdom-framework

Wisdom Framework

Versions

Version
0.3.0
0.2.6
0.2.4