6 Performance Pitfalls when using Spring Data JPA

6 Performance Pitfalls when using Spring Data JPA

Thanks to its ease of use, Spring Data JPA is an incredibly popular persistence framework. If developers have something to complain about, they usually criticize object-relational mapping in general or the risk of performance problems. And while you can, of course, criticize the concept of object-relational mapping, you shouldn’t blame Spring Data JPA for your…

Database portability – Pitfalls when supporting multiple RDBMS with Hibernate

Database portability – Pitfalls when supporting multiple RDBMS with Hibernate

The JPA specification and Hibernate, as its most popular implementation, claim to provide database portability. That means you don’t need to change your persistence code or mapping annotations when connecting your application to a different RDBMS. They achieve that by providing an automated object-relational mapping, an API that abstracts from the executed SQL statements, and…

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…