Red Hat

In Relation To Hibernate OGM

In Relation To Hibernate OGM

Hibernate OGM 5.1 Beta3 and 5.0.4 are out

Posted by    |       |    Tagged as Hibernate OGM Releases

Hello everybody, holidays are over and we decided to start back with a small release.

Hibernate OGM 5.1 Beta3 and a new 5.0 maintainance releases are now available.

In these releases we fixed some issues around sequence generation and queries on entities using the single table per class inheritance strategy. An update is highly recommended.

Hibernate OGM 5.0.4.Final is backward compatible with 5.0.3.Final. If you need to upgrade from a version before 5.0, you can find help on the migration notes.

All the details about these releases are on the 5.0.4.Final changelog, the 5.1.0.Beta2 changelog and the 5.1.0.Beta3 changelog.

What happened to 5.1 Beta2?

Think of it as the crazy uncle nobody wants to talk about, you should check 5.1 Beta3 instead.

Where can I get them?

5.0.4.Final

You can get the required core library using the following Maven coordinates:

  • org.hibernate.ogm:hibernate-ogm-core:5.0.4.Final

and these are the backends currently available:

  • Cassandra: org.hibernate.ogm:hibernate-ogm-cassandra:5.0.4.Final

  • CouchDB: org.hibernate.ogm:hibernate-ogm-couchdb:5.0.4.Final

  • Infinispan: org.hibernate.ogm:hibernate-ogm-infinispan:5.0.4.Final

  • Ehcache: org.hibernate.ogm:hibernate-ogm-ehcache:5.0.4.Final

  • MongoDB: org.hibernate.ogm:hibernate-ogm-mongodb:5.0.4.Final

  • Neo4j: org.hibernate.ogm:hibernate-ogm-neo4j:5.0.4.Final

  • Redis: org.hibernate.ogm:hibernate-ogm-redis:5.0.4.Final

Alternatively, you can download archives containing all the binaries, source code and documentation from Sourceforge.

5.1.0.Beta3

You can get the required core library using the following Maven coordinates:

  • org.hibernate.ogm:hibernate-ogm-core:5.1.0.Beta3

and these are the backends currently available for 5.1.0.Beta3:

  • Cassandra: org.hibernate.ogm:hibernate-ogm-cassandra:5.1.0.Beta3

  • CouchDB: org.hibernate.ogm:hibernate-ogm-couchdb:5.1.0.Beta3

  • Infinispan

    • Embedded: org.hibernate.ogm:hibernate-ogm-infinispan:5.1.0.Beta3

    • Remote: org.hibernate.ogm:hibernate-ogm-infinispan-remote:5.1.0.Beta3

  • Ehcache: org.hibernate.ogm:hibernate-ogm-ehcache:5.1.0.Beta3

  • MongoDB: org.hibernate.ogm:hibernate-ogm-mongodb:5.1.0.Beta3

  • Neo4j: org.hibernate.ogm:hibernate-ogm-neo4j:5.1.0.Beta3

  • Redis: org.hibernate.ogm:hibernate-ogm-redis:5.1.0.Beta3

Alternatively, you can download archives containing all the binaries, source code and documentation from Sourceforge.

What’s next?

We are getting ready for the first 5.1 candidate release.

How can I get in touch?

You can find us through the following channels:

We are looking forward to hear your feedback!

Today we release Hibernate OGM 5.1.0.Beta1 and 5.0.3.Final.

In version 5.1 we introduce an amazing new feature: support for storing data in Infinispan Server using the Java Hot Rod client, encoding your data into Google Protobuffers, while handling all the nasty mapping automatically.

Hot Rod support?

Hot Rod is the protocol used by "intelligent clients" of an Infinispan Server, which implies the client is smart enough to implement a series of performance optimisation tricks; for example it is able to connect to the most suited server in the cluster depending on the data being requested (or written), greatly reducing the latency of operations.

While Infinispan is most known as an high-performance key/value store, when it comes to remote clients the recommended approach is to encode your data in Google Protobuffers. This allows for evolution of your storage schema without breaking decoding of existing data, allows server side queries and functions to interpret the stored data, and allows interoperability with Hot Rod clients from other programming languages. It allows for example to read the POJOs we write using the Java client from a Python client, and have the data converted into reasonable Python Objects.

Unfortunately dealing with an Hot Rod client can be tedious!

  • It’s a key-value store: manual handling of object relations is error prone

  • You’ll need to write and maintain a matching Protobuf Schema for all your entities

  • You’ll have to setup Protostream and configure it as Marshaller for the Hot Rod client

Most importantly, it requires new skills.

You’ll have to learn how a Protobuf Schema is best defined, and how to use Protostream. Finally, you’ll have to learn the Hot Rod API and how to make the most of its advanced flags to tune each operation, and consider carefully how you want to represent relations.

Use something familiar instead?

Hibernate OGM can automate the tedious parts, and let you focus on what matters: storing your objects.

Add this dependency:

<dependency>
    <groupId>org.hibernate.ogm</groupId>
    <artifactId>hibernate-ogm-infinispan</artifactId>
    <version>5.1.0.Beta1</version>
</dependency>

Enable OGM’s Hot Rod super powers in your persistence.xml :

<?xml version="1.0"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
        version="2.0">

        <persistence-unit name="ogm-with-hotrod">
                <provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider> (1)
                <properties>
                        <property name="hibernate.ogm.datastore.provider"
                                value="infinispan_remote" /> (2)
                        <property name="hibernate.ogm.infinispan_remote.client.server_list"
                                value="127.0.0.1:11222" /> (3)
                </properties>
        </persistence-unit>
</persistence>
1 Choose Hibernate OGM as JPA Provider
2 pick infinispan_remote as datastore
3 include Hot Rod configuration properties, just replacing/adding the OGM prefix.

Start Hibernate OGM!

EntityManagerFactory emf = Persistence.createEntityManagerFactory("ogm-with-hotrod");

That’s enough to create Hibernate EntityManagers which knows how to perform CRUD of your model, encoding and decoding your data into Hot Rod!

This will:

  • Start and manage the Hot Rod client, have it initialize connections to your Infinispan Server

  • Generate an appropriate Protobuf Schema for your model

  • Deploy the schema to the Infinispan Server

  • Initialize all the internal Protobuf encoders and decoders using Protostream

  • Properly implement sequences / autoincrements (a feature lacking in native Hot Rod)

There are some limitations.

The most notable one is that you will have to manually create the Cache definitions that it will need on your Infinispan Server configuration, as at this time this is an operation which can’t be performed over Hot Rod (but the friendly Infinispan team is working on a solution).

Another limitation is that at this time we don’t support running JPQL queries on this backend.

You can find many more interesting details in our Infinispan integration reference guide; I’ve included a section to help you choose between Infinispan Embedded and Infinispan Remote (over Hot Rod).

Of course many more fixes made it into this release; for a full overview see the 5.1.0.Beta1 changelog.

Hibernate OGM 5.0.3.Final

We also released Hibernate OGM version 5.0.3.Final, to address a single mapping issue: many thanks to Simone Manetti for reporting OGM-1198, now resolved in this version.

Here is the full 5.0.3.Final changelog.

If you need to upgrade from a version before 5.0, you can find help in the migration notes.

What’s next?

Version 5.1 is feature complete now. We’re looking forward to your feedback!

How can I get in touch?

You can find us through the following channels:

The first hibernate OGM 5.1 Alpha and 5.0.2 Final

Posted by    |       |    Tagged as Hibernate OGM Releases

Good news!

We released Hibernate OGM 5.1 Alpha1 and 5.0.2 Final!

What’s new?

Hibernate OGM 5.0.2.Final

Hibernate OGM 5.0.2.Final now supports MongoDB 3.2 and it’s still backward compatible with Hibernate OGM 5.0.1.Final.

If you need to upgrade from a version before 5.0, you can find help on the migration notes.

The 5.0.2.Final changelog contains all the details about the changes in this release.

Hibernate OGM 5.1.0.Alpha1

Hibernate OGM 5.1.0.Alpha1 brings support for Neo4j in remote mode. The user will have the option to choose between the new Bolt protocol or the more familiar HTTP interface.

We also started to re-work the way Hibernate OGM groups operations before running them; this reduce the number of calls and commands to execute on the datastore, leading to better performance.

The 5.1.0.Alpha1 changelog contains all the details about the changes in this release.

How can I try the remote Neo4j dialect?

You can test Hibernate OGM support for Neo4j adding the following dependency to your project:

<dependency>
    <groupId>org.hibernate.ogm</groupId>
    <artifactId>hibernate-ogm-neo4j</artifactId>
    <version>5.1.0.Alpha1</version>
</dependency>

and setting the following properties:

# Required
hibernate.ogm.datastore.provider = neo4j_bolt # or neo4j_http

# Optional
hibernate.ogm.datastore.host = myproject.example.com:8989
hibernate.ogm.datastore.username = example_username
hibernate.ogm.datastore.password = example_password

You can get more information about this integration and how to configure it in the Neo4j section of the documentation.

Where can I get them?

5.0.2.Final

You can get the required core library using the following Maven coordinates:

  • org.hibernate.ogm:hibernate-ogm-core:5.0.2.Final

and these are the backends currently available:

  • Cassandra: org.hibernate.ogm:hibernate-ogm-cassandra:5.0.2.Final

  • CouchDB: org.hibernate.ogm:hibernate-ogm-couchdb:5.0.2.Final

  • Infinispan: org.hibernate.ogm:hibernate-ogm-infinispan:5.0.2.Final

  • Ehcache: org.hibernate.ogm:hibernate-ogm-ehcache:5.0.2.Final

  • MongoDB: org.hibernate.ogm:hibernate-ogm-mongodb:5.0.2.Final

  • Neo4j: org.hibernate.ogm:hibernate-ogm-neo4j:5.0.2.Final

  • Redis: org.hibernate.ogm:hibernate-ogm-redis:5.0.2.Final

Alternatively, you can download archives containing all the binaries, source code and documentation from Sourceforge.

5.1.0.Alpha1

You can get the required core library using the following Maven coordinates:

  • org.hibernate.ogm:hibernate-ogm-core:5.1.0.Alpha1

and these are the backends currently available for 5.1.0.Alpha1:

  • Cassandra: org.hibernate.ogm:hibernate-ogm-cassandra:5.1.0.Alpha1

  • CouchDB: org.hibernate.ogm:hibernate-ogm-couchdb:5.1.0.Alpha1

  • Infinispan: org.hibernate.ogm:hibernate-ogm-infinispan:5.1.0.Alpha1

  • Ehcache: org.hibernate.ogm:hibernate-ogm-ehcache:5.1.0.Alpha1

  • MongoDB: org.hibernate.ogm:hibernate-ogm-mongodb:5.1.0.Alpha1

  • Neo4j: org.hibernate.ogm:hibernate-ogm-neo4j:5.1.0.Alpha1

  • Redis: org.hibernate.ogm:hibernate-ogm-redis:5.1.0.Alpha1

Alternatively, you can download archives containing all the binaries, source code and documentation from Sourceforge.

What’s next?

The major addition in the next release will be the integration with Infinispan remote via the HotRod protocol.

How can I get in touch?

You can find us through the following channels:

We are looking forward to hear your feedback!

On the way to the remote Neo4j server integration

Posted by    |       |    Tagged as Hibernate OGM

Hibernate OGM has been able for a while to work with an embedded Neo4j instance. In the next release, we want to add the ability to connect to a remote Neo4j server.

A new binary protocol is available since Neo4j 3 to connect to a remote server: Bolt.

In addition to Bolt, Neo4j comes also with a RESTful API and we are wondering if we should add an option to switch between the two approaches.

To sum up, given the option, would you choose the RESTful API instead of Bolt to connect to Neo4j using Hibernate OGM?

This is the right time to let us know what you think.

First Hibernate OGM 5 maintenance release

Posted by    |       |    Tagged as Hibernate OGM Releases

We released Hibernate OGM 5.0.1.Final!

What’s new?

Here some of the most interesting bug fixes and improvements in this release:

  • OGM-818 - Autodetection support for @Entity annontated classes will now work

  • OGM-356 - Object comparison in JPQL queries for MongoDB and Neo4j

  • OGM-1065 - You can now use Hibernate OGM with Cassandra 3 (Thanks joexner!)

You can find all the details in the changelog.

This release is backward compatible with Hibernate OGM 5.0.0.Final but if you need to upgrade from a previous version, you can find help on the migration notes.

Where can I get it?

You can get Hibernate OGM 5.0.1.Final core via Maven using the following coordinates:

  • org.hibernate.ogm:hibernate-ogm-core:5.0.1.Final

and these are the back-ends currently available:

  • Cassandra: org.hibernate.ogm:hibernate-ogm-cassandra:5.0.1.Final

  • CouchDB: org.hibernate.ogm:hibernate-ogm-couchdb:5.0.1.Final

  • Infinispan: org.hibernate.ogm:hibernate-ogm-infinispan:5.0.1.Final

  • Ehcache: org.hibernate.ogm:hibernate-ogm-ehcache:5.0.1.Final

  • MongoDB: org.hibernate.ogm:hibernate-ogm-mongodb:5.0.1.Final

  • Neo4j: org.hibernate.ogm:hibernate-ogm-neo4j:5.0.1.Final

  • Redis: org.hibernate.ogm:hibernate-ogm-redis:5.0.1.Final

Alternatively, you can download archives containing all the binaries, source code and documentation from SourceForge.

How can I get in touch?

You can find us through the following channels:

We are looking forward to hear your feedback!

In this post, I’d like you to meet Mark Paluch, who, among other projects, is one of our Hibernate OGM project contributors.

  1. Hi, Mark. Would you like to introduce yourself and tell us what you are currently working on?

    I am Mark Paluch, and I am working for Pivotal Software as Spring Data Engineer. I am a member of the JSR 365 EG (CDI 2.0), project lead of the lettuce Redis driver, and I run a couple of other open source projects. I enjoy tinkering on Internet of Things projects in my spare time. Before I joined Pivotal, I worked since the early 2000’s as a freelancer in a variety of projects using Java SE/EE and web technologies. My focus lies now on Spring Data with Redis, Cassandra, and MongoDB in particular.

  2. You have contributed a lot to the Hibernate OGM Redis module. Can you please tell us a little bit about Redis?

    I was not the first one bringing up the idea of Redis support in Hibernate OGM. In fact, Seiya Kawashima did a pretty decent job with his pull-request but at some point, Hibernate OGM development and the PR diverged. I came across the pull request and picked it up from there.

    Redis is an in-memory data structure store, used as database, cache and message broker. It originated from a key-value store but evolved by supporting various data structures like lists, sets, hashes and much more. Redis is blazing-fast although it runs mostly single-threaded. Its performance originates in a concise implementation and that all operations are performed in-memory. This does not mean that Redis has no persistence. Redis is configured by default to store data on disk and disk I/O is asynchronous. Redis facilitates through its versatile nature an enormous number of use-cases such as Caching, queues, remote locking, just storing data and much more. An important fact to me is always that I’d never use Redis for data I cannot recover as wiping data from Redis is just too easy but using it as semi-persistent a store is the perfect use.

  3. You are also the author of the Lettuce open source project. How does it compare to Hibernate OGM?

    Hibernate OGM and lettuce are projects with different aims. Lettuce is a driver/Java-binding for Redis. It gives Java developers access to the Redis API using synchronous, asynchronous and reactive API bindings. You can invoke the Redis API with lettuce directly and get the most out of Redis if you need it. Any JDBC driver is situated on a similar abstraction level as lettuce except for some specific features. lettuce does not require connection-pooling and dealing with broken connections as it allows users to benefit from auto-reconnection and thread-safe connections. Hibernate OGM Redis uses this infrastructure and provides its data mapping features on top of lettuce.

  4. What benefit do you think Hibernate OGM offers to application developers compared to using the NoSQL API directly?

    Each NoSQL data store has its own, very specific API. Native APIs require developers not only get familiar with the data store traits but also with its API. Redis API comes with over 150 commands that translate to 650+ commands with sub-command permutations.

    Every Redis command is very specific and behaves on its own. The Redis command documentation provides detailed insight to commands, but users are required to spend a fair amount of their time to get along with the native API.

    Hibernate OGM applies elements from the JPA spec to NoSQL data stores and comes up with an API that Java EE/JPA developers are familiar. Hibernate OGM lowers barriers to entry. Hibernate OGM comes with a purpose of mapping data into a NoSQL data store. Mapping simple JPA entities to the underlying data store works fine but sometimes, like associations or transactions, do not map well to MongoDB and Redis. Users of Hibernate OGM need to be aware of the underlying persistence technology to get familiar with its concepts and strengths as well with their limitations.

    I also see a great advantage of the uniform configuration mechanism of Hibernate OGM. Every individual datastore driver comes up with its individual configuration method. Hibernate OGM unifies the styles into a common approach. One item on my wish list for Hibernate OGM is JDNI/WildFly configuration support to achieve similar flexibility as it is possible with JDBC data sources.

  5. Do you plan on supporting Hibernate OGM in Spring Data as well?

    Hibernate OGM and Spring Data follow both the idea of supporting NoSQL data stores. Hibernate OGM employs several features from NoSQL data stores to enhance its data mapping centering around JPA. JPA is an inherently relational API, which talks about concepts that are not necessarily transferable to the NoSQL world. Spring Data comes with modules for various popular data stores with a different approach to providing a consistent programming model for the supported stores but not try to force everything into a single abstracting API. Spring Data Modules provide multiple levels of abstraction on top of the NoSQL data store APIs. Core concepts of NoSQL data stores are exposed through an API that commonly looks and feels like Spring endpoints. Hibernate OGM can already be used together with Spring Data JPA. A good use-case is the Spring Data Repositories abstraction which provides a uniform interface to access data from various data stores that do not require users to write a query language and leverages store-specific features.

Thank you, Mark, for taking your time. It is a great honor to have you here. To reach Mark, you can follow him on Twitter.

Meet Sergey Chernolyas

Posted by    |       |    Tagged as Discussions Hibernate OGM Interview

In this post, I’d like you to meet Sergey Chernolyas who is one of our Hibernate OGM project contributors.

  1. Hi, Sergey. You are one of the people who contributed to the Hibernate OGM project. Can you please introduce yourself?

    Hi, Vlad! My name is Sergey Chernolyas. I am from Russia, and I am 38 years old. I have been working with Java technologies since 2000. During my career, I got four certificates on Java technologies from Oracle and got involved in many development and integration projects.

  2. Can you tell us what project are you currently working on and if it uses Hibernate OGM?

    Now, I am working on a new module for Hibernate OGM, which aims to integrate the OrientDB NoSQL database. With this module, OGM will support a total of 7 NoSQL databases. Although at my current job, my work is not related to NoSQL solutions or Hibernate OGM, I am interested in this topic, and that’s why I pushed myself to learn Hibernate OGM and exploring NoSQL databases.

  3. Can you tell us a little about OrientDB?

    OrientDB is a graph-oriented and document-oriented database, and it is built using Java technologies. Briefly, the main advantages of using OrientDB are:

    1. It can operate in several modes: as an in-memory database, or through a network connection, or it can be store data in a local file.

    2. It offers join-less entity associations.

    3. It supports stored procedures that may be written in Java, JavaScript and any other language implementing the JSR-223 specification (e.g. Groovy, JRuby, etc.).

    4. It has good performance and is Big Data-oriented.

      For more details about OrientDB, you can visit the official documentation. Recently, the OrientDB team released the 2.2 GA version, so it’s worth giving it a try.

  4. What is the main benefit of using Hibernate OGM for accessing OrientDB over using their native API?

    The main benefit of using Hibernate OGM over the native API is the standard way for application development. Also, Hibernate OGM hides many low-level operations for creating and managing database connections, or for executing queries.

    While implementing the first version of the OrientDB Hibernate OGM module, I was faced with some OrientDB issues that prevented me integrate all features that ought to be supported by any Hibernate OGM module. Luckily, the OrientDB team was helpful and supportive, and I hope that by the time I finish this integration, the OrientDB team had already fixed my previously reported issues.

Thank you, Sergey for taking your time, and keep up the good work.

Hibernate OGM 5 is out!

Posted by    |       |    Tagged as Hibernate OGM Releases

Hibernate OGM 5.0.0.Final is finally here!

What’s new?

Compared to the 4.2.Final, this version includes:

There are also several bug fixes and you can find all the details in the changelog.

A nice Getting started guide is available on our website for people who want to start playing with it. A more in depth explanation of all the details around Hibernate OGM is in the reference documentation.

If you need to upgrade from a previous version, you can find help on the migration notes.

What’s coming next?

Now that Hibernate OGM 5 is out, we can focus on working on some new integrations like Neo4j remote and Hot Rod.

You can also have a look at the roadmap for up-to-date news about what’s coming next.

If you think that something is missing or if you have some opinion about what we should include, please, let us hear your voice.

Where can I get it?

You can get Hibernate OGM 5.0.0.Final core via Maven using the following coordinates:

  • org.hibernate.ogm:hibernate-ogm-core:5.0.0.Final

and these are the back-ends currently available:

  • Cassandra: org.hibernate.ogm:hibernate-ogm-cassandra:5.0.0.Final

  • CouchDB: org.hibernate.ogm:hibernate-ogm-couchdb:5.0.0.Final

  • Infinispan: org.hibernate.ogm:hibernate-ogm-infinispan:5.0.0.Final

  • Ehcache: org.hibernate.ogm:hibernate-ogm-ehcache:5.0.0.Final

  • MongoDB: org.hibernate.ogm:hibernate-ogm-mongodb:5.0.0.Final

  • Neo4j: org.hibernate.ogm:hibernate-ogm-neo4j:5.0.0.Final

  • Redis: org.hibernate.ogm:hibernate-ogm-redis:5.0.0.Final

Alternatively, you can download archives containing all the binaries, source code and documentation from SourceForge.

How can I get in touch?

You can find us through the following channels:

We are looking forward to hear your feedback!

We are getting closer and closer to the final release of Hibernate OGM 5.

This release includes support for Redis Cluster and a new dialect to store data within Redis hashes; java.util.UUID are now using the native uuid type in Apache Cassandra; more queries are now supported using the MongoDB CLI syntax.

This release is also aligned to the Hibernate 5 family and it will work with Hibernate ORM 5, Hibernate Search 5.5 and the latest WildFly 10. Check the previous post for more details about it.

The migration notes contains more information about migrating from earlier versions of Hibernate OGM to 5.x.

Have a look at the change log for a list of everything included in this release.

Redis Cluster support

Enabling the support for Redis Cluster is a matter of setting the following property to true:

hibernate.ogm.redis.cluster = true

When this property is enabled, data will be stored across Redis cluster nodes according to the Redis key distribution model on the hash slot of the key of each entity.

Check the documentation for more details about the configuration options for Redis in Hibernate OGM.

Redis hash mapping

When using this mapping, data is stored using key-values pairs using Redis hashes. The benefit of this approach is that it allows partial updates.

You can enable this dialect setting the following property:

hibernate.ogm.datastore.grid_dialect = org.hibernate.ogm.datastore.redis.RedisHashDialect

This will map the following entity:

@Entity
public class News {

    @Id
    private String id;

    @Version
    @Column(name="version")
    private int version;

    private String title;

    private String description;

    //getters, setters ...
}

with the following properties:

version     = 1
title       = On the merits of NoSQL
description = This paper discuss why NoSQL will save the world for good

A huge thanks to community member Mark Paluch, responsible for both these great improvements in the Redis area. Note that these features are both experimental for the time being.

Additional MongoDB native CLI queries support

Thanks to the contribution of Thorsten Möller, Hibernate OGM now supports more type of queries using the MongoDB CLI syntax: findOne, findAndModify, insert, remove and update.

Here an example showing how you can use them:

OgmSession session = ...

String nativeQuery = "db.OscarWilde.findAndModify({"
        + "'query': {'author': 'oscarwilde'}, "
        + "'update': { '$set': { 'author': 'Oscar Wilder' } }, "
        + "'new': true "
        + "})";

Query query = session.createNativeQuery( nativeQuery ).addEntity( OscarWilde.class );
List<OscarWilde> result = query.list();

You can find more details in the documentation about experimental support of native MongoDB queries.

What’s coming next?

We are working on the Neo4j remote dialect and we are focused on releasing a stable version of Hibernate OGM 5.

Where can I get it?

You can get Hibernate OGM 5.0.0.CR1 via Maven etc. using the following coordinates:

  • org.hibernate.ogm:hibernate-ogm-core:5.0.0.CR1 for the Hibernate OGM core module

  • org.hibernate.ogm:hibernate-ogm-<%BACKEND%>:5.0.0.CR1 for the NoSQL backend you want to use, with _<%BACKEND%> being one of "mongodb", "redis", "neo4j", etc.

Alternatively, you can download archives containing all the binaries, source code and documentation from SourceForge.

How can I get in touch?

You can get in touch through the following channels:

We are looking forward to hear your feedback!

It’s 3 days from Christmas and as a present we decided to release the first Beta of Hibernate OGM 5!

The major news in this release is the mapping support for Cassandra 2.2 new data types, proper handling of the @Lob annotation, post-load event support and Infinispan 8.

This release also continue the process of aligning Hibernate OGM to the Hibernate 5 family. After the passage to Hibernate ORM 5 in the previous release, we updated Hibernate Search to the 5.5 version that also includes the power of Apache Lucene 5.

In the previous release post we described the improvements about storing map-typed properties on MongoDB and Redis. We have now applied the same natural mapping on CouchDB.

Check out the Hibernate OGM migration notes to learn more about migrating from earlier versions of Hibernate OGM to 5.x.

Cassandra 2.2 new data types

  • date for properties mapped using @Temporal(TemporalType.DATE)

  • time for properties mapped using @Temporal(TemporalType.TIME)

  • tinyint for java.lang.Byte

  • smallint for java.lang.Short

PostLoad event support

Thanks to David Williams contribution, the @PostLoad annotation will now work with Hibernate OGM.

If you are not familiar with this annotation, it’s part of the JPA spec and it allows to specify callback methods for the corresponding lifecycle event.

@Entity
public class Zoo {

   @Id
   private Integer id;

   @ElementCollection
   private Set<Animal> animals = new HashSet<Animal>();

   private int nrOfAnimals;

   ...

   @PostLoad
   public void postLoad() {
       nrOfAnimals = animals.size();
   }
}

The postLoad() method will be called after all the eagerly fetched fields of the class Zoo have been loaded from the datastore allowing us to inizialize the value of the attribute nrOfElement.

Note that this code follows the JPA spec and it could be use in the same way with Hibernate ORM or any other JPA compliant project.

How can I add support for a new data store?

I’m glad you ask, community member Mark Paluch contributed to the documentation adding a new section that explains the different components involved in the creation of a new backend: How to build support for a data store

What’s coming next?

The major features we are planning to include in the next release are the support for the Neo4j remote server and an alternative dialect for Redis which persists values right into hash fields.

Where can I get it?

You can retrieve Hibernate OGM 5.0.0.Beta1 via Maven etc. using the following coordinates:

  • org.hibernate.ogm:hibernate-ogm-core:5.0.0.Beta1 for the Hibernate OGM core module

  • org.hibernate.ogm:hibernate-ogm-<%BACKEND%>:5.0.0.Beta1 for the NoSQL backend you want to use, with <%BACKEND%> being one of "mongodb", "redis", "neo4j" etc.

Alternatively, you can download archives containing all the binaries, source code and documentation from SourceForge.

As always, we are looking forward to your feedback. The change log tells in detail what’s in there for you. Get in touch through the following channels:

back to top