Hibernate OGM is not maintained anymore

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