The differences between Spring Data JPA’s save, saveAndFlush and saveAll methods

The differences between Spring Data JPA’s save, saveAndFlush and saveAll methods

Spring Data JPA’s standard repositories provide a set of methods that handle common operations used by most persistence layers. That saves us a lot of time and allows us to focus on our business logic. But we also need to ask ourselves which of these methods we want to use. You need to know how…

How to generate UUIDs as primary keys with Hibernate
| |

How to generate UUIDs as primary keys with Hibernate

Most developers prefer numerical primary keys because they are efficient to use and easy to generate. But that doesn’t mean that a primary key has to be a number. UUIDs, for example, have gained some popularity over recent years. The main advantage of a UUID is its (practical) global uniqueness which provides a huge advantage…

Spring Data JDBC – Modelling and working with aggregates

Spring Data JDBC – Modelling and working with aggregates

Entities, aggregates, and aggregate roots are some of the core concepts used by Spring Data JDBC. Based on them, Spring Data JDBC decides which objects it loads or persists together. They also define which kind of associations you can model. That shows how important it is to understand both concepts and how they work together….