From the course: Creating Spring Boot Microservices
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Declare JPA repositories - Spring Boot Tutorial
From the course: Creating Spring Boot Microservices
Declare JPA repositories
- [Instructor] Using just JPA, the next step would be creating services which invoke the entity manager to create read, update, and delete entity objects. Instead, we are going to use Spring Data JPA framework and we'll see how Spring Data JPA gives us better functionality while writing less code. In the last chapter, we chose to include the Spring Data repository dependency, Spring Data abstracts away from any particular data source by following a repository pattern. Now we're actually going to see the implementation of that pattern. Spring Data starts with a Java repository interface with two bounded type parameters. The first type, T, is the entity class name, and the second parameter ID is the type of the unique ID of the entity. The repository interface is just a marker without any methods. Crudrepository is a Spring Data artifact common to many types of data sources. It extends from repository and declares methods that create update, read, and delete entities, which inherit the…
Contents
-
-
-
-
-
(Locked)
The domain model2m 9s
-
(Locked)
The persistence entities2m 2s
-
(Locked)
Declare JPA repositories4m 36s
-
(Locked)
Spring Data JPA repository dependency injection3m 48s
-
(Locked)
Invoking the repositories7m 33s
-
(Locked)
Introduction to Spring Data query methods3m 2s
-
(Locked)
Challenge: Create a JPQL query method38s
-
(Locked)
Solution: Create a JPQL query method2m 35s
-
(Locked)
-
-
-
-
-
-
-