Skip to content

xvik/guice-persist-orient

Repository files navigation

Guice integration for OrientDB

License CI Appveyor build status codecov

DOCUMENTATION: http://xvik.github.io/guice-persist-orient/

Examples repository

Support: Gitter chat

guice-persist-orient wins 4th place in Software Quality Award 2015

About

OrientDB is document, graph and object database (see intro and starter course). Underlying format is almost the same for all database types, which allows us to use single database in any way. For example, schema creation and updates may be performed as object database (jpa style) and graph api may be used for creating relations.

Features:

  • For orient 3.1 (java 8)
  • Integration through guice-persist (UnitOfWork, PersistService, @Transactional)
  • Support for document, object and graph databases
  • Database types support according to classpath (object and graph db support activated by adding jars to classpath)
  • All three database types may be used in single transaction (changes will be visible between different apis)
  • Hooks for schema migration and data initialization extensions
  • Extension for orient object to scheme mapper with plugins support
  • Auto mapping entities in package to db scheme or using classpath scanning to map annotated entities
  • Auto db creation (for memory, local and plocal)
  • Different db users may be used (for example, for schema initialization or to use orient security model), including support for user change inside transaction
  • Support method retry on ONeedRetryException
  • Spring-data like repositories with advanced features (e.g. generics usage in query). Great abilities for creating reusable parts (mixins). Support plugins.
  • Basic crud mixins with ability to use object api for graphs
  • Compatible with Play framework

Thanks to

Setup

Maven Central

Maven:

<dependency>
    <groupId>ru.vyarus</groupId>
    <artifactId>guice-persist-orient</artifactId>
    <version>4.1.0</version>
</dependency>
<!--
<dependency>
    <groupId>com.orientechnologies</groupId>
    <artifactId>orientdb-object</artifactId>
    <version>3.1.12</version>
</dependency>
<dependency>
    <groupId>com.orientechnologies</groupId>
    <artifactId>orientdb-graphdb</artifactId>
    <version>3.1.12</version>
</dependency>-->

Gradle:

implementation 'ru.vyarus:guice-persist-orient:4.1.0'
//implementation "com.orientechnologies:orientdb-object:3.1.12"
//implementation "com.orientechnologies:orientdb-graphdb:3.1.12"

Commented imports required to enable object and graph db support.

OrientDB Guice guice-persist-orient
3.1 5.0.1 4.1.0
3.0 5.0.1 4.0.0
2.2 4.2.0 3.3.2
2.1 4.1.0 3.2.0
2.0 4.0.0 3.1.1
1.0 4.0.0 2.1.0

NOTE: It's very important for object db to use exact javassist version it depends on. If other libraries in your classpath use javassist, check that newer or older version not appear in classpath.

Snapshots

You can use snapshot versions through JitPack:

  • Go to JitPack project page
  • Select Commits section and click Get it on commit you want to use (top one - the most recent)
  • Follow displayed instruction: add repository and change dependency (NOTE: due to JitPack convention artifact group will be different)

Usage

Read documentation

Might also like

  • generics-resolver - extracted library, used for generics resolution during finders analysis
  • dropwizard-orient-server - embedded orientdb server for dropwizard
  • guice-validator - hibernate validator integration for guice (objects validation, method arguments and return type runtime validation)
  • guice-ext-annotations - @Log, @PostConstruct, @PreDestroy and utilities for adding new annotations support

Contribution

Contributions are always welcome, but please check before patch submission:

$ gradlew check

java lib generator