Back to course

Defining JPA Entities

Spring Boot 0 to Hero: The Complete Java Backend Masterclass

Mapping Objects to Tables

An @Entity class represents a table in the database. Every field in the class represents a column. Use @Id and @GeneratedValue for primary keys.