EJB3 persistence with hibernate

Since my trip to java posting I looked into EJB3 persistence (JSR-220) with hibernate as promised. It’s shocking how much the EJB3 specification resembles hibernate – Gavin King apparently got most if his hibernate semantics in there. I believe it’s a good thing though. Former hibernate developers can adapt the new sepecification with little effort and on the other hand the definition of persitience classes has been cleaned up nicely with properly defined annotations.
So far I’ve been able to create a simple example application with the hibernate entitymanager/annotations engine. It simply creates two objects, stores them in the database an reads them again with a query. The rest of this post shows how this example app is set up.
Continue reading