@NaturalId – A good way to persist natural IDs with Hibernate?

@NaturalId – A good way to persist natural IDs with Hibernate?

In the real world, most objects have a natural identifier. Typical examples are the ISBN number of a book, a company’s tax identifier or a person’s social security number. You could, of course, use these identifiers as primary keys. But most often, it’s a better idea to generate numeric, surrogate keys. They are easier to…

How to fetch multiple entities by id with Hibernate 5
| |

How to fetch multiple entities by id with Hibernate 5

It happens quite often that you have to load multiple entities by their primary keys. And new developers are often surprised when they learn that JPA and Hibernate versions before 5.1 do not offer a simple API for it. With JPA and older Hibernate versions, you have 2 options to fetch multiple entities from the database: You…