Learn how to create new Spring Data JPA CrudRepository interfaces using JPA entities.
- [Instructor] The classic means to create, read, update,…and delete JPA entities was to invoke the entity manager.…While better than straight JTBC or spring JTBC template,…it's use still resulted in repetitive boiler plate code.…Functions were the same only the data was different.…With Spring Data JPA, we write less code…to accomplish the same functionality.…To use Spring Data JPA for a JPA entity…we declare a Java interface class…that extends from CrudRepository,…where T is the domain type the repository manages…and ID is the type of the ID of the entity…the repository manages.…
So let's create the tour JPA repository interface.…First I'm going to create a package…First I'm going to create a package…called repo under com example EC.…Then a tour repository interface.…And I'm going to extend from crud repository.…The first parameter is tour.…The second parameter is the type of the ID of tour,…The second parameter is the type of the ID of tour,…which in this case is integer.…
So what does that give us?…Well a lot actually.…
Released
12/20/2016- Setting up the project
- Building, deploying, and launch the microservice
- Declaring Spring Data JPA repository interfaces
- Invoking repositories
- Using Spring Data query methods
- Exposing RESTful APIs with Spring Data REST
- Using the /search resource to invoke query methods
- Paging and sorting
- Declaring a new REST controller
- Creating HTTP methods for creating, reading, updating and deleting persistent data.
Share this video
Embed this video
Video: Declare Spring Data JPA repository interfaces