Defining Entities & Repositories
Create JPA entities to map to database tables and define repository interfaces for data access.
Welcome to Data Persistence
In this lesson, we'll learn how to connect your Java application to a database using Spring Boot. This is called data persistence, meaning your data lives on even after your app stops.
We'll focus on two core concepts:
- Entities: Your Java objects that map to database tables.
- Repositories: Interfaces that provide easy ways to interact with your entities and the database.
What's a JPA Entity?
A JPA Entity is a plain Java class that represents a table in your relational database. Each instance of this class corresponds to a row in that table.
The Java Persistence API (JPA) is a standard for managing relational data in Java applications. Spring Data JPA builds on this to simplify database interactions even further.