Persistence

Persistence with JPA and Hibernate is one of the main topics in my daily work and on this blog. This page provides an overview of the articles I wrote about this topic and you should expect more of them in the future.

JPA 2.1

JPA 2.1 introduced a set of new features to the specification to make the work with a relational database easier and more efficient. You can get an overview about all the new features in:

Or if you already know what you are searching for, have a look at the list of JPA 2.1 related articles:

 

Result Set Mappings

If queries get complex, the limited feature set of JPQL can become an issue and we need to use native SQL queries. The only downside of it is, that native queries return a List<Object[]> and that we need to cast all these Objects into the right type. An easy solution for it are Result Set Mappings which I explained in a series of blog posts:

 

Performance

Persisting data with Hibernate and JPA is easy, but you need to be aware of some things to avoid performance pitfalls:

 

Test

I usually use Arquillian to test my Java EE applications with the application server that will be used in production. Arquillian and the persistence extension can be used to manage the container, deploy the application and manage the database. I described how to do this in: