Help

It's my great pleasure to announce the release of Hibernate OGM 4.1.0.Beta3. This release is focused on an improved experience when working with the Neo4j graph datastore and several improvements in the field of querying (the complete change log can be found here).

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.Beta3 for the Hibernate OGM engine and
  • org.hibernate.ogm:hibernate-ogm-<datastore>:4.1.0.Beta3, depending on the backend you want to use.

Improved support for Neo4j

We now take advantage of labels - a new feature of Neo4J 2.x - to map entities in a more natural way. We use these labels to tag all the nodes belonging to one entity type. This does not only remove the need to put additional properties to the nodes but also will allow us to query for all the nodes of one entity type in an efficient manner.

We also support the execution of native Cypher queries now. You can either create them ad-hoc via EntityManager#createNativeQuery() or using the @NamedNativeQuery annotation on your entities:

@Entity
@NamedNativeQuery(
    name = "AnimalsBySpecies",
    query = "MATCH ( n: Animal { species: {species} } ) RETURN n",
    resultClass = Animal.class 
)
public class Animal { ... }
    
EntityManager em = ...
List<Animal> giraffes = em.createNamedQuery( "AnimalsBySpecies", Animal.class )
    .setParameter( "species", "Giraffe" )
    .getResultList();

As you can see in the example, native queries for Neo4j also support named parameters via the native Cypher parameter syntax.

The work on the Neo4j dialect is in full swing these days and you can expect to see further improvements in this field in the Beta4 release.

Query improvements

When working with queries you can now make use of setFirstResult() and setMaxResults() to page through a result set. This works for JP-QL as well as native MongoDB queries:

EntityManager em = ...;
List<Animal> giraffes = em.createQuery( "FROM Animal WHERE species = 'Giraffe'" )
    .setFirstResult( 51 )
    .setMaxResults( 100 )
    .getResultList();

Furthermore there is support for ORDER BY clauses in JP-QL queries now:

List<Animal> giraffes = em.createQuery( "FROM Animal WHERE species = 'Giraffe' ORDER BY name DESC" )
    .getResultList();

These two things together should be of great help when using Hibernate OGM to implement typical CRUD use cases (create, read, update, delete) on top of your NoSQL store.

What's next?

For Beta4 we plan to translate JP-QL queries into native Cypher queries for the Neo4j backend. We also got some ideas for performance improvements and will take a look into a more natural mapping of assocations to Neo4j relationships.

The MongoDB dialect should see some improvements around querying as well and we plan on investigating an error report and compensation API. This will offer the ability to collect errors on partially executed units of work on stores without full transactional semantics and the ability to react to these errors.

Needless to say, your feedback matters very much to us. So 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.

3 comments:
 
04. Jun 2014, 20:26 CET | Link
Mattysek
hibernate ogm neo4j module currently on sourceforge has invalid module.xml to fix this issue:

||
...wildfly\modules\org\hibernate\ogm\neo4j\main\module.xml

change <resource-root path="parboiled-java-1.1.6" /> to this: <resource-root path="parboiled-java-1.1.6.jar" />
ReplyQuote
 
20. Jun 2014, 15:45 CET | Link

Thanks for the report; This will be fixed by OGM-553 scheduled for the next Beta.

 
02. Sep 2014, 04:07 CET | Link
^This calculation adeptness even go bigger. If a woman buys a set of <a href="http://www.iplsa.org/online.html">replica shoes</a> accouterment again affairs a backpack which matches her accouterment actualization is a must. Here, a man who understands a woman's animosity would never footfall back. Certainly, this man would move added and advice her in affairs the a lot of capital handbag. Thanks to the high-street shops and the websites that acquaint women accouterment as able-bodied as their handbags. The varieties of minibags that are begin in these places acquire to be appreciated. Currently, there is a acceleration in the bulk of women who are arcade duke accoutrements from websites. This befalling has acclimatized continued abandon to a abounding bulk of women to do arcade of their abundance handbags. When few women are accepting interviewed on this trend again they told that they adopt to buy handbags just by sitting afore their claimed computers. It saves a lot of their time and money. They are consistently in favor of the <a href="http://www.puglias-sporting-goods.com/right.html">gucci replica</a> offers and discounts which let them buy the best handbags at a lower price. Sometimes, it happens that women on affairs clothes from markets they do not acquisition the appropriate affectionate of ladies handbags which go alongside with their dress code. In this case, they acquire to seek for their adapted minibags in the assorted websites until they acquisition them. Thus, we acquire appear to apperceive that handbags bulk a lot to women <a href="http://www.rmhneworleans.org/log.html">dior replica</a>. About the Author: Matthew Watson is a able biographer and anon autograph on online arcade industry accoutrement Kids wear, mens artist clothes, iphones accessories and sports accessories etc. While abounding alive women acquire to buy accurate artist handbags for themselves, they are able to do so because they are earning their own salary. For fashion-conscious girls who still depend on their parents for their allowance, however, artist handbags are apparently able-bodied aloft their bulk range. Instead, broad handbags are absolute for girls who still wants to attending good. Replica backpack broad artist handbags are accessible at low prices that even abounding girls are able to <a href="http://www.replicawatches0.co.uk">replica watches</a> afford, afterwards compromising on looks.^Click HELP for text formatting instructions. Then edit this text and check the preview.
Post Comment