RSSAmplifier

Blog

Vlad Mihalcea

High-Performance Java Persistence, Hibernate, and SQL

vladmihalcea.comRSS feed ↗10 posts

Latest posts

How to emulate LEFT JOIN FETCH using Record-based projections

Introduction In this article, I’m going to show you how to emulate a LEFT JOIN FETCH between two root entities without fetching the intermediate child entity. I got the inspiration for this article by this comment thread on my blog. Domain Model Let’s assume we have the following entities: The Post is the root entity of our hierarchy, but just like it’s the case with the relational model, the root…

The best way to replace the deprecated GenericGenerator

Introduction In this article, I’m going to show you the best way to replace the deprecated @GenericGenerator when upgrading your application to Hibernate 7. Hibernate @GenericGenerator annotation The @GenericGenerator annotation has been available since Hibernate 3.5, as an alternative to the <generator> XML element from HBM mappings. As illustrated by the Hibernate 6.5 @GenericGenerator Javadoc,…

Book Review &#8211; Just Use Postgres!

Introduction My friend, Denis Magda, wrote a wonderful book called Just Use Postgres!, and I’m glad that I got the chance to read it. Audience This book is useful for any software developer who’s either using PostgreSQL or plans on using it because it covers a lot of features that are very useful for modern applications. No matter your level of seniority, you are definitely going to learn from…

The best way to clean up test data with Spring and Hibernate

Introduction In this article, I’m going to show you the best way to clean up test data when using Spring and Hibernate. While it’s very common to use the @DataJpaTest annotation when implementing integration tests, in this blog post, you will see why you are better off avoiding using this annotation. Why I don’t use @DataJpaTest As explained by the manual, Spring Boot provides the @DataJpaTest…

Book Review &#8211; Troubleshooting Java

Introduction My friend, Laurentiu Spilca, has been working on the second edition of his Troubleshooting Java book, and when I was asked to review it, I was more than happy to do it since the book features a lot of topics that I’m also very interested in, such as performance tuning and query optimization. Audience This book is useful for any Java developer because it teaches you how to get the best…

Twelve years of blogging

Twelve years later! Twelve years ago today, I decided to create this blog on WordPress.com to share whatever I was finding interesting while working as a software architect. Prior to starting this blog, I didn’t have any writing experience, which you can clearly see in the first article I’ve ever published. However, practice makes perfect, and in time, I managed to learn how to express myself in…

MySQL Query Optimization with Releem

Introduction In this article, I’m going to show you how to optimize the queries executed by a Spring application running on MySQL using Releem. For a short introduction about Releem, check out this previous article, in which I explained how to set up Releem to collect metrics from your MySQL database. Spring Petclinic application The application under test is going to be the well-known Spring…

Foundations of AI and Machine Learning for Java Developers Course Review

Introduction In this article, I’m going to review the Foundations of AI and Machine Learning for Java Developers video course from my fellow Java Champion, Frank Greco. If you are new to AI and ML and want to get a great introduction to these topics, then you should definitely join watch the video lessons created by Frank Greco. And, thanks to LinkedIn Learning’s generosity, until June 20, you can…

How to map the Oracle TIMESTAMP WITH TIME ZONE with JPA

Introduction In this article, I’m going to explain how to map the Oracle TIMESTAMP WITH TIME ZONE with JPA and Hibernate. While the DATE and TIMESTAMP column types are suitable for mapping the LocalDateTime, the TIMESTAMP WITH TIME ZONE column type allows us to map both the ZonedDateTime and OffsetDateTime. Oracle TIMESTAMP WITH TIME ZONE Traditionally, Oracle provided the DATE and TIMESTAMP…

MySQL Performance Tuning with Releem

Introduction If your application uses MySQL and you’re interested in getting the best out of it via performance tuning and monitoring, then Releem is a very nice tool that can assist you in your endeavor. I discovered Releem from Roman Agabekov’s posts on social media. Roman is the founder of this tool, and since his posts about MySQL performance tuning are very insightful, I decided to give it a…