How to get the query execution plan on SQL Server

Introduction In this article, we are going to see how we can get the query execution plan when using the SQL Server relational database system. The execution plan allows you to understand the operations done by the database engine when executing a specific SQL query.

Query timeout with JPA and Hibernate

Introduction In this article, we are going to see what is the best way to set up the query timeout interval with JPA and Hibernate. Setting the query timeout allows you to cancel slow-running queries that would, otherwise, put pressure on database resources.

The best way to use the JPQL DISTINCT keyword with JPA and Hibernate

Introduction In this article, we are going to how the JPQL DISTINCT keyword behaves depending on the underlying entity query type.

Query pagination with JPA and Hibernate

Introduction Inspired by this StackOverflow answer I gave recently, I decided it’s time to write an article about query pagination when using JPA and Hibernate. In this article, you are going to see how to use query pagination to restrict the JDBC ResultSet size and avoid fetching more data than necessary.

How to map a JPA entity to a View or SQL query using Hibernate

Introduction In this article, you are going to learn how to map a JPA entity to the ResultSet of a SQL query using the @Subselect Hibernate-specific annotation.

How to solve the PostgreSQL :: cast operator issue with JPA and Hibernate

Introduction While answering questions on the Hibernate forum, I stumbled on the following question, and, since it’s very interesting, I decided to turn the answer into a dedicated blog post.