Entities

One of the core components of JPA is a JPA entity. This entity allows applications to transfer data to and from the database. You can think of an entity as a class representation of a database table. When we want to retrieve data from a database, we extract it from the target table and place it inside an entity. When we want to add data to…

Relational databases with Spring Data

Spring Data provides several unified ways to work with any relational databases. The most common one of them is Spring Data JPA. In this topic, we will demonstrate how to start using this approach step by step and then consider a few use cases of the three popular databases: H2, PostgreSQL, and MySQL. Following the same approach, you can start working with any other relational…

CRUD repositories

A typical application works with data and has a database to store it. Let’s imagine such an application. What can it do with the data? First of all, this data has to be stored (or created) in the database. Then, of course, we want this application to read the data. After reading, we might want to update it or delete it from the database. All…

Introduction to Spring Data

One of the most significant parts of a real-world application is the place where the data is stored. It affects the internal structure and performance of the whole application, and it may also simplify or complicate its future development. Considering that there are lots of databases (such as MySQL, Postgres, MongoDB, Redis, and many others), the way we interact with them becomes exceptionally important.