This video goes over building data access through the Repository pattern and Spring Data JPA for our embedded database. It walks through building the first entity and repository and then shows the other repositories built.
- [Narrator] So now that we've talked a little bit…about what spring data is…it's time for us to jump right into…the spring data framework.…We're going to navigate to src, main, java.…So we're going to create a new package…called com.frankmoley,…again, your name is going to be different…based on your group,….landon.data.entity.…And in this package we are going to create…a new class called Room.…
Alright, so now in this class…we're going to create several attributes,…a long ID, a String name,…a String for our room number,…and a String for bedInfo.…And if you go back to our schema file…you will see that all of the attributes…that we just added to the class…come from the schema of our ROOM.…
We've got the ROOM_ID, and the NAME, and the ROOM_NUMBER,…and the BED_INFO,…but you might also notice here…that the names don't match our attribute names.…So because we're using hibernate…we're going to have to put some annotations on this class.…So let's go ahead and get started…with those hibernate entities.…We have to annotate them with @Entity annotation…
- Creating a project with Spring Initializr
- Examining the Spring Boot skeleton project with Spring Data JPA
- Creating an embedded database for Spring Boot development and testing
- Building a service abstraction
- Using the IoC paradigm in Spring to develop a service layer
- Building a controller
- Testing a controller MockMvc
- Exposing a service layer through REST
Skill Level Intermediate
Q: This course was updated on 09/06/2018. What changed?
A: The following topics were updated: creating a project with Spring Initializr, examining the Spring Boot skeleton project, developing a service object with Spring, and testing a controller MockMvc.