Help
No profile available.
Archive

We are getting closer to a final release and this version is mainly about improving general performance and reducing the amount of round trips to the datastore. We also added optimistic locking support for datastores which provide atomic find-and-update operations.

We also worked on several bug fixes and improvements under the hood, you can read more about it in the release note.

Optimistic locking detection

With Hibernate ORM, you can add optimistic locking capability to an entity using the @Version annotation:


@Entity
public class Flight implements Serializable {
...
    @Version
    @Column(name="OPTLOCK")
    public Integer getVersion() { ... }
} 


So far Hibernate OGM’s support for this was limited to CouchDB, which has its own proprietary optimistic locking mechanism. In this release we added support for optimistic locking also for those datastores that provide atomic find-and-update semantics such as MongoDB.

As always, you can either download a release bundle from SourceForge or get the JARs from the JBoss Nexus repository server using Maven, Gradle etc. The GAV coordinates are:

  • org.hibernate.ogm:hibernate-ogm-core:4.1.0.Beta8 for the OGM engine and
  • org.hibernate.ogm:hibernate-ogm-<datastore>:4.1.0.Beta8, depending on the backend you want to use.

What's next?

We are currently focused is on improving performance, documentation, polishing the API and fixing last minute bugs.

You're very welcome to raise your voice on the mailing list, ask questions in the forum or report any bugs or feature requests in the issue tracker.

It's my pleasure to announce a new release of Hibernate OGM.

Hibernate OGM can now convert JP-QL queries into cypher queries when working with Neo4j. We improved the JSON representation used for associations in CouchDB and MongoDB making it more concise. We also worked on several bug fixes and improvements under the hood, you can read more about it in the release note.

As always, you can either download a release bundle from SourceForge or retrieve the JARs from the JBoss Nexus repository server using Maven, Gradle etc. The GAV coordinates are:

  • org.hibernate.ogm:hibernate-ogm-core:4.1.0.Beta5 for the OGM engine and
  • org.hibernate.ogm:hibernate-ogm-<datastore>:4.1.0.Beta5, depending on the backend you want to use.

From JP-QL to Cypher

For example, if you execute the following JP-QL query:

from Hypothesis h where h.author IN ('alma', 'alfred')

OGM will execute the following Cypher query on Neo4j:

MATCH (h:Hypothesis) WHERE ANY(_x_ IN ["alma", "alfred"] WHERE h.author = _x_) RETURN h

The following subset of JP-QL constructs is available at the moment:

  • simple comparisons
  • IS NULL and IS NOT NULL
  • the boolean operators AND, OR, NOT
  • LIKE, IN and BETWEEN
  • ORDER BY

More natural mapping for associations in MongoDB and CouchDB

In the previous releases, an entity with an association looked something like the following JSON:

{
   "_id": "4f5b48ad",
   ...
   "rows": [
       {
           "bankAccounts_id": "7873a2a7"
       }
   ]
}

We got rid of the name of the id in the rows field, this will now look like:

{
   "_id": "4f5b48ad",
   ...
   "rows": [
       {
           "7873a2a7"
       }
   ]
}

What's next?

Some work on the Neo4j side is still required to make the mapping of the entities more natural. We also want to add caching in several places to improve performance (OGM-541, OGM-515, OGM-522).

We are also discussing about a solution for the generation of error reports with the failed operations on non-transactional db.

You're very welcome to raise your voice on the mailing list, ask questions in the forum or report any bugs or feature requests in the issue tracker.

I'm happy to announce a new release of Hibernate OGM.

The MongoDB backend now supports the MongoDB CLI syntax for native queries. In Neo4j, we have solved a bug related to the way we store embedded collections (OGM-549) and we now create only one relationship for bidirectional associations. We have also worked on the compatibility with WildFLy 8.1. You can find more details about this release on JIRA.

As always, you can either download a release bundle from SourceForge or retrieve the JARs from the JBoss Nexus repository server using Maven, Gradle etc. The GAV coordinates are:

  • org.hibernate.ogm:hibernate-ogm-core:4.1.0.Beta4 for the OGM engine and
  • org.hibernate.ogm:hibernate-ogm-<datastore>:4.1.0.Beta4, depending on the backend you want to use.

Support for MongoDB CLI syntax

You can now specify queries using the MongoDB CLI syntax as shown in the following example:

    @Entity
    class Poem {
       ...
       String name;
       String author;
       ...
    }

    String poemsQuery = "db.Poem.find({'$query': { 'author': 'Oscar Wilde' }, '$orderby': { 'name': 1 }})";

    EntityManager em = ...
    List<Poem> oscarWildePoems = (List<Poem>)em.createNativeQuery( poemsQuery, Poem.class )
                                 .getResultList();

Currently only find() and count() queries are supported via the CLI syntax.

One relationship for bidirectional associations

In Neo4j, it is possible to navigate a relationship in both directions at the same speed. We moved to a more natural mapping using one relationship (instead of two) for a bidirectional association.

What's next?

For the Neo4j backend, we plan to make the mapping for one-to-one relationships more natural, remove redundant properties and translate JP-QL queries into native Cypher queries.

We will also work on the generation of error reports with the failed operations on non-transactional db.

You're very welcome to raise your voice on the mailing list, ask questions in the forum or report any bugs or feature requests in the issue tracker.

30. Oct 2013, 16:00 CET, by Davide D'Alto

After one month from the previous release we are happy to announce the new Hibernate OGM 4.0.0.Beta4.

Initial embedded Neo4j integration

Hibernate OGM can now work with Neo4j, a fully transactional property graph database.

Graph databases represent the data as a system of interconnected nodes and work well when you need to store information like the relationship between people in social networks. In addition, in a property graph, you can also add properties to the elements of the graph.

Hibernate OGM maps an entity as a node where the attributes of the entity become properties of the node. At the moment we add some additional properties for the conversion of the node into the entity but we are planning to replace them using the label mechanism added in the latest Neo4j versions.

The relationship between two nodes represents an association between two entities. Currently a bidirectional association requires two relationships but we are going to change this since Neo4j can navigate a relationship in both directions.

The integration with Neo4j is experimental but we are planning on improving it soon. Please, let us know what you think or help us improving it.

Native query support for MongoDB

One missing feature in the previous releases was the ability to retrieve managed entities using the query language of the database of your choice. This is particularly useful if the query language supports specific features unavailable to JP-QL or currently non implemented.

We started to work on this feature and it is now possible to execute a MongoDB query using the org.hibernate.Session or the javax.persistence.EntityManager.

Let's look at an example using the session:

List<OscarWildePoem> result = session
    .createSQLQuery( "{ $query : { author : 'Oscar Wilde' }, $orderby : { name : 1 } }" )
    .addEntity( OscarWildePoem.TABLE_NAME, OscarWildePoem.class )
    .list();

and one using the entity manager:

List<OscarWildePoem> results = entityManager
    .createNativeQuery( "{ $query : { author : 'Oscar Wilde' }, $orderby : { name : 1 } }", OscarWildePoem.class )
    .getResultList();

How to try it

You can take a look at the documentation or check how you can download Hibernate OGM 4.0.0.Beta4.

Many thanks to all the contributors that made this release possible whether it be via pull requests, bug reports or feedback on the forum.

30. Sep 2013, 14:09 CET, by Davide D'Alto

We have been very quiet on the announcement front for Hibernate OGM, but don't be fooled. Davide and Gunnar have been very busy bees and did bring significant foundation work for features that you will see in the next few months.

Improved query support around projection and operators

Based on the foundation of our JP-QL parser, we have added support for more JP-QL queries:

Supported operators

  • operators =, <, <=, >, =, IN, LIKE, BETWEEN
  • Supported boolean combinations: AND, OR, NOT
  • Support for simple property projections and embedded objects

In practice, that means that you can write the following JP-QL query and have it run for example on Infinispan.

select u.firstname, u.lastname from User u where (u.age BETWEEN 12 AND 18) OR u.supervision = 'free'

As a reminder, we now support for following query features:

  • operators =, <, <=, >, =>, IN, LIKE, BETWEEN
  • boolean combinations: AND, OR, NOT
  • simple proprerty projections
  • embedded objects
  • parametric queries

JP-QL query support for MongoDB

We now convert JP-QL queries into MongoQL queries and run them to retrieve entities. This is only the beginning and our support is comparable to the Lucene support.

This is a significant step forward for us as we proved our tool chain can handle what we are planning.

Discriminator based hierarchy

OGM now supports the single table per class strategy for the mapping of hierachies. In this case a column will be added to differentiate between entity types in a hierarchy. Previously, you had to store subclasses in different tables.

JBoss AS 7 integration module

JBoss AS comes with a module system offering better packages and isolated libraries. We have added Hibernate OGM as a module to simplify JBoss AS users.

Support for Wildfly is coming soon.

Support for Hibernate Search mass indexing

When using Hibernate Search in conjunction with Hibernate OGM, you could not index entities using the MassIndexer.

This is now fixed and we are back to an efficient indexing.

Next

Expect more regular releases from us from now on. We forgot our release early, release often mantra but that has to stop!

As an example, expect support for Neo4J as well as the ability to pass native queries (for example to MongoDB) and retrieve managed objects.

How to try it

You can take a look at the documentation or check how you can download Hibernate OGM 4.0.0.Beta3.

Many thanks to all the contributors that made this release possible whether it be via pull requests, bug reports or feedback on the forum.