JPA 2.2’s new getResultStream() method and how you should NOT use it
|

JPA 2.2’s new getResultStream() method and how you should NOT use it

JPA 2.2 introduced several new features, and one of them is the new getResultStream() method. This method is now part of the Query interface. As you might guess from its name, it allows you to retrieve the result of your query as a Stream. The goal of this method is to provide an efficient way to…

Entities or DTOs – When should you use which projection?
| |

Entities or DTOs – When should you use which projection?

JPA and Hibernate allow you to use DTOs and entities as projections in your JPQL and Criteria queries. When I talk about Hibernate performance in my online training or at a workshop, I get often asked, if it matters which projection you use. The answer is: YES! Choosing the right projection for your use case…

8 Ways to use the features of your database with Hibernate
| |

8 Ways to use the features of your database with Hibernate

A common misconception when working with Hibernate is that you can only map database tables and don’t use any other database features. That’s not the case, as I want to show you in this post. You can also use lots of other features which allow you to: Map read-only database views Call database functions Execute…