Defining an Entity
Learn how to create an entity and look at different JPA annotations for defining a relational mapping.
We'll cover the following...
We'll cover the following...
JPA dependency
To use Spring Data JPA, we will add the starter JPA dependency to the pom.xml
file of the tennis-player
project as follows:
Press + to interact
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-jpa</artifactId></dependency>
When the pom.xml
file is saved, we can see the JPA API in the Maven Dependencies folder. This API defines a lot of different annotations like @Entity
, @Column
, @Table
, etc. Hibernate is an implementation of the JPA API which automatically gets configured in our application. The hibernate-core
jar can be seen in the Maven Dependencies folder.
We will take the tennis player database example to ...