How to configure List semantics in Hibernate 6
|

How to configure List semantics in Hibernate 6

Based on its javadoc, a java.util.List is supposed to represent an ordered collection of values. But that’s not necessarily the case if you use it as the type of a to-many association or an ElementCollection. As I explained before, Hibernate can handle a java.util.List as a Bag or a List. Only the List mapping persists the order…

MutationQuery and SelectionQuery in Hibernate 6
|

MutationQuery and SelectionQuery in Hibernate 6

One of the smaller changes in Hibernate 6 that can easily get overlooked, which Steve Ebersole presented in a recent Expert Session in the Persistence Hub, is the introduction of the MutationQuery and SelectionQuery interfaces. It allows the separation between queries that change data and the ones that select it from the database. Older Hibernate…

Hibernate 6 EmbeddableInstantiator – Instantiate embeddables your way
| |

Hibernate 6 EmbeddableInstantiator – Instantiate embeddables your way

Embeddables are simple Java objects. They provide an easy way to define and group a set of attributes that become part of your entity. Developers often use them to create reusable mapping information and handle them using the same piece of business code. Unfortunately, the JPA specification and Hibernate until version 6.0.0, required your embeddable…