Here's what I've written (so far):

Baeldung on Java

  • All
  • Spring Data (6)
  • NoSQL (6)
  • Testing (5)
  • Security (4)
  • HTTP Client-Side (4)
  • Spring Boot (3)
  • Jackson (3)
  • Core Java (3)
  • Spring Web (2)
  • REST (2)
  • Java IO (2)
  • JPA (2)
  • Web Services (1)
  • Uncategorized (1)
  • Spring WebFlux (1)
  • Spring Persistence (1)
  • Spring MVC (1)
  • Reactive (1)
  • Persistence (1)
  • Networking (1)
  • Logging (1)
  • Java Numbers (1)
  • Java Map (1)
  • Java Dates (1)
  • Java (1)
  • Jakarta EE (1)
  • JSON (1)
  • Data (1)
  • Architecture (1)

Preventing Jackson From Fetching Lazy Entity Fields

Working with JPA and Jackson often raises the challenge of serializing entities that contain lazy-loaded associations. This tutorial shows how to prevent Jackson from triggering unwanted database queries when lazy fields are uninitialized; we’ll look at DTOs, annotations, and Jackson’s own jackson-datatype-hibernate6 module.

Read More →

TupleTransformer and ResultListTransformer in Hibernate

While JPQL projections solve many cases, sometimes we need more flexibility, like mapping complex DTOs, restructuring query results, or post-processing the entire result set. Hibernate’s former answer for this is ResultTransformer. Hibernate 6, however, replaces it with two new interfaces. This article shows how to work with TupleTransformer for row-level transformations and ResultListTransformer for list-level processing.

Read More →