O'Reilly logo

MongoDB for Java Developers by Francesco Marchioni

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building a JPA project that uses Hibernate OGM

As most readers have some skills with Hibernate or JPA, we will reuse an example that was originally presented in an earlier book of mine (https://www.packtpub.com/networking-and-servers/jboss-5-development). The purpose of this exercise will be to demonstrate how you can apply a MongoDB storage to a standard application using Hibernate or JPA.

This example application simulates a simple online store where you can register new customers and add/issue new orders for each customer.

Here is the basic structure of our entity objects:

Building a JPA project that uses Hibernate OGM

Now start NetBeans and from the File menu select New Project. Within the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required