Help
No profile available.
Archive

For more information, please see:

Most changes applied to both versions. Of note are:

  • HHH-9312 fixed a database connection leak with JTA transaction tracking caused by a transaction timeout detected by a background thread with the transaction rolled back immediately; the background thread was not closing the database connection when Synchronization.afterCompletion(int status) was called; instead, the database connection was not closed until the next application request that used the affected Hibernate session.
  • HHH-9387, HHH-9389, and HHH-9390 fixed some bugs in generated table and foreign key column names for collections when JPA annotations were used. Because these fixes could break existing applications (that rely on the incorrectly generated table and column names) they are not fixed by default. A new API (NamingStrategyDelegator) was added (HHH-9388) to enable these fixes because the NamingStrategy API was too inflexible to allow making changes without causing regressions when a custom NamingStrategy is used. NamingStrategy has been deprecated (HHH-7079 in favor of this new API. Documentation for the NamingStrategyDelegator API has not been added to the manual yet, and the API is not supported in the standalone schema tools yet. Both will be added in 4.3.8 and 4.2.17. For now, you can see details about enabling the fix in the Jira issues.
  • HHH-9305 fixed various bugs in SQL generated for HQL queries that contain an implicit join. The following are examples of HQL affected by this bug are:
       // e.department is implicitly joined in the "select" clause, and is explicitly joined in the "from" clause
       select e.department from Employee e inner join e.department

       // a.zoo is implicitly joined in the "select", "where", and "order by" clauses
       select distinct a.zoo from Animal a where a.zoo is not null order by a.zoo.name

There were several fixes made to 4.3.7 (only):

  • HHH-8839 fixed a bug that caused an IllegalStateException when rendering the SQL for loading an entity with an eager map having an entity key.
  • HHH-8895 fixed a bug that caused a SQLGrammarException when enabling a filter that is defined on a @MappedSuperclass hierarchy because the filter condition was getting applied to all tables in the hierarchy, instead of just one where the filter is defined.
  • HHH-3868 fixed a bug that caused NullPointerException when merging an entity Merging transient entity with an @Embeddable property containing a @org.hibernate.annotations.Parent mapping.

JBoss Nexus: https://repository.jboss.org/nexus/content/groups/public/org/hibernate
Maven Central: http://repo1.maven.org/maven2/org/hibernate/hibernate-core (should update in a couple of days)

SourceForge: https://sourceforge.net/projects/hibernate/files/hibernate4
4.3.7.Final Downloads: 4.3.7.Final ZIP, 4.3.7.Final TGZ
4.2.16.Final Downloads: 4.2.16.Final ZIP, 4.2.16.Final TGZ

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.

Showing 1 to 5 of 6 blog entries