Welcome to the Hibernate community newsletter in which we share blog posts, forum, and StackOverflow questions that are especially relevant to our users.

Articles

Valentin Kovalenko wrote a very good summary of why it would be worth to pass the IN query clause parameters using an ARRAY and a single bind parameter value. This functionality is not yet implemented in Hibernate, but we should definitely investigate it for Hibernate ORM 6.

The JPA EntityManager exposes the persist and merge methods if you want to insert an entity or to update it after it was changed in the detached state. However, Hibernate offers three additional methods (save, update, and saveOrUpdate) which can also be used to trigger an INSERT or UPDATE statement. This article explains the difference between persist, merge, save, update, and saveOrUpdate.

If you want to learn how to executes aggregate queries using JPQL, then this article gives you a short introduction to this topic.

This article explains how to map a java.time.Year using a JPA AttributeConverter. If you want to use a Hibernate Type, or if you want to map java.time.Month or java.time.YearMonth, then check out this article.

If you using Spring Boot, this article explains how to customize the Hibernate naming strategies.

Logging the current database transaction identifier is a very useful feature when you want to aggregate all log messages that belong to the same database transaction. This article introduces the MDC (Mapped Diagnostic Context) feature supported by many Java logging solutions and which allows you to pass variables programmatically to log entries.

Time to upgrade

The Hibernate ORM project got two new maintenance releases 5.3.8 and 5.3.9.

If you’re using Hibernate Validator 6, you might want to upgrade to version 6.0.15 which was just released


Back to top