Cheat Sheet: New Features in JPA 2.1

JPA 2.1 introduced 12 new features, like StoreProcedureQueries, Entity Graphs and Attribute Converter, to make your work with the database easier and more efficient.
Download your free New Features in JPA 2.1 cheat sheet now, to get all the information you need to improve your database access.

This 5 page cheat sheet brings you:

- a short description and
- code snippets for each feature,
- links to more detailed articles.

Signup now and get your free New Features in JPA 2.1 cheat sheet and regular blog updates.

I respect your privacy and have ZERO TOLERANCE for spam!

Result Set Mapping: The Basics

Quite often JPQL is not powerful enough to perform the queries we need in real world projects. In general, this is not an issue because JPA is designed as a leaky abstraction and we can use the full potential of SQL by using native queries or calling stored procedures.
The only downside is, that these queries return a List of Object[] instead of the mapped entities and value objects we are used to work with. Each Object[] contains one record returned by the database. We then need to iterate through the array, cast each Object to its specific type and map them to our domain model. This creates lots of repetitive code and type casts as you can see in the following example.


It would be more comfortable, if we could tell the EntityManager to map the result of the query into entities or value objects as it is the case for JPQL statements. The good news is, JPA provides this functionality. It is called SQL result set mapping and we will have a detailed look at it during this series:
  • Result Set Mapping: The Basics
  • Result Set Mapping: Complex Mappings
  • Result Set Mapping: Constructor Result Mappings (coming soon)
  • Result Set Mapping: Hibernate specific features (coming soon)

Java Weekly 15/15: GC tuning, HTTP2, good Javadoc, MVC 1.0 early draft

The Java world is evolving at a rapid pace and it can be challenging to keep track of it. Fortunately lots of great resources are created every week, explaining new features or looking at existing stuff from a different angle.

I am using the Java Weekly series to collect the most interesting links I found during the last week and present them to you all in one place. I hope you find it useful and that it makes it easier for you to keep up-to-date. If you like to suggest a resource or something I can improve on, please leave me a comment.



Java Weekly: April Fools Edition

Normally, I am using the Java Weekly series to collect the most interesting Java related links. But today I prepared a special April Fool Edition for you. I hope you enjoy it.



Java Weekly 14/15: log4j memory leaks, JBatch monitoring and more...

The Java world is evolving at a rapid pace and it can be challenging to keep track of it. Fortunately lots of great resources are created every week, explaining new features or looking at existing stuff from a different angle.

I am using the Java Weekly series to collect the most interesting links I found during the last week and present them to you all in one place. I hope you find it useful and that it makes it easier for you to keep up-to-date. If you like to suggest a resource or something I can improve on, please leave me a comment.



My Trip to JavaLand 2015

Last week, I attended the JavaLand 2015 conference in Brühl, Germany. If you follow me on twitter, you have probably seen me tweeting about it. And what shall I say, it was a great conference! Well organized, lots of interesting sessions, great discussions and everything happening in a theme park. Yes, that's right: it took place in the Phantasialand theme park!

And did I already mention that I hosted a Java quiz as one of the community activities? :-D

Java Weekly 13/15: JCache, RESTful conversations, Java EE Management and more...

The Java world is evolving at a rapid pace and it can be challenging to keep track of it. Fortunately lots of great resources are created every week, explaining new features or looking at existing stuff from a different angle.

I am using the Java Weekly series to collect the most interesting links I found during the last week and present them to you all in one place. I hope you find it useful and that it makes it easier for you to keep up-to-date. If you like to suggest a resource or something I can improve on, please leave me a comment.



Java Weekly 12/15: CDI, templating in MVC, Keycloak, recorded sessions and more...

The Java world is evolving at a rapid pace and it can be challenging to keep track of it. Fortunately lots of great resources are created every week, explaining new features or looking at existing stuff from a different angle.

I am using the Java Weekly series to collect the most interesting links I found during the last week and present them to you all in one place. I hope you find it useful and that it makes it easier for you to keep up-to-date. If you like to suggest a resource or something I can improve on, please leave me a comment.