Inspired by this comment on my blog, in this article, we are going to see how to use a UUID entity identifier that is auto-generated by Hibernate either in the JVM or using database-specific UUID functions.
Post entity looks as follows:
Post entity has a UUID identifier and a title. Now, let’s see how we can map the
Post entity so that the UUID identifier be auto-generated for us.
Continue reading “How to use a JVM or database auto-generated UUID identifier with JPA and Hibernate”
While answering this question on the Hibernate forum, I realized that it’s a good idea to write an article about getting the actual execution plan for an Oracle SQL query using Hibernate query hints feature.
Continue reading “How to get the actual execution plan for an Oracle SQL query using Hibernate query hints”
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.
Continue reading “How to map a JPA entity to a View or SQL query using Hibernate”
Sergey Chupov asked me a very good question on Twitter:
In this article, I’m going to show you how to cache null results when using JPA and Hibernate.
Continue reading “How to cache non-existing entity fetch results with JPA and Hibernate”
On the Hibernate forum, I noticed the following question which is about using the Hibernate Query Cache for storing DTO projections, not entities.
While caching JPQL queries which select entities is rather typical, caching DTO projections is a lesser-known feature of the Hibernate second-level Query Cache.
Continue reading “How to use the Hibernate Query Cache for DTO projections”