Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pedrycz/nohibernate-core

Non-relational data mapping for Hibernate, useful for persisting Java interfaces
https://github.com/pedrycz/nohibernate-core

hibernate java nosql sql

Last synced: 5 days ago
JSON representation

Non-relational data mapping for Hibernate, useful for persisting Java interfaces

Awesome Lists containing this project

README

        

NoHibernate
==========

NoHibernate provides mapping of Hibernate managed entities in non-relational way. It is especially useful for storing in database interfaces with many different child classes, which is almost impossible with pure Hibernate.

[![](https://jitpack.io/v/ppedrycz/nohibernate-core.svg)](https://jitpack.io/#ppedrycz/nohibernate-core)

### Gradle setup
```gradle
repositories {
...
maven {
url 'https://jitpack.io'
}
}

dependencies {
...
compile("com.github.ppedrycz:nohibernate-core:0.2")
}
```

### Maven setup
```xml


jitpack.io
https://jitpack.io


com.github.ppedrycz
nohibernate-core
0.2

```

### Library initialization
```Java
public class MyApplication {
public static void main(String[] args) {

NoHibernateUtils.setClassLoader(MyApplication.class.getClassLoader());

/* rest of your code */

}
}
```

### Example usage
```Java
public class Geometry { /* fields, getters, setters */ }
public class Point extends Geometry { /* fields, getters, setters */ }
public class Rectangle extends Geometry { /* fields, getters, setters */ }
public class Circle extends Geometry { /* fields, getters, setters */ }
public class Square extends Geometry { /* fields, getters, setters */ }
public class Polygon extends Geometry { /* fields, getters, setters */ }
public class Triangle extends Geometry { /* fields, getters, setters */ }

@Entity
public class Sprite {

/* constructors, other fields, getters, setters */

@Type(type = NoHibernate.Type.BASIC)
private Geometry geometry;

}

```