Most list endpoints start the same way: a SQL query, a few joins, a LIMIT/OFFSET, and a DTO. It works fine. Until it doesn’t. I had a breaking point with a list page that needed to filter by data three relationships away from the root entity. The join got ugly fast. Pagination got weird. Adding […] The post Graph-Style Queries…
#query
4 posts
26 May
20 Sept 2023
Introduction In this article, we are going to see how we can find the source of an SQL query generated by Hibernate. Knowing where a given SQL query originates from is very useful when trying to investigate performance issues caused by either long-running queries or queries that are executed excessively (e.g., N+1 query issues). Hypersistence Utils This feature that we…
14 Mar 2023
Introduction In this article, we are going to see how Spring Data query methods are built, when you should use them, and especially when you should avoid them. I decided to write this article after answering this StackOverflow question, which depicts an 87-character-long Spring Data query method. TL;DR, Don’t write query methods that cannot even fit on the screen. Spring…
14 Nov 2014
We’ve recently encountered this interesting use-case on the jOOQ user group. How do you discover all primary keys of your schema via the jOOQ API? There are two ways: Using the generated meta data Using runtime meta data Let’s see how it works: Using the generated meta data This is straightforward. If you’re using Java … Continue reading jOOQ Tip…