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…

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…

@DiscriminatorFormular – Modeling Single Table Inheritance Without a Discriminator

@DiscriminatorFormular – Modeling Single Table Inheritance Without a Discriminator

Inheritance is one of the key concepts of all object-oriented programming languages. And Java makes there no difference. All developers are familiar with this concept and expect to use it in all parts of their code. That, of course, also includes the persistence layer and the entity model. But the concept of inheritance doesn’t exist…