Welcome to the Hibernate community newsletter in which we share blog posts, forum, and StackOverflow questions that are especially relevant to our users.
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.
EntityManager exposes the
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 (
saveOrUpdate) which can also be used to trigger an INSERT or UPDATE statement.
This article explains the difference between
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.YearMonth, then check out
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.