Code Monkey home page Code Monkey logo

wisdom-orientdb's Introduction

Wisdom-OrientDB

Build 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.

The optional orientdb.<alias>.autolazyloading boolean property is a convenient way to configure the default orientDB lazy loading behavior.

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;}
//...

wisdom-orientdb's People

Contributors

barjo avatar jenf11 avatar cescoffier avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.