From the course: Java Persistence with JPA and Hibernate

Unlock the full course today

Join today to access over 23,400 courses taught by industry experts.

Solution: Art Class Management app, part 6

Solution: Art Class Management app, part 6 - JPA Tutorial

From the course: Java Persistence with JPA and Hibernate

Solution: Art Class Management app, part 6

(upbeat electronic music) - [Instructor] Now I'll go through step by step how I solve this challenge. First, in the app package, I created a new package named Repository Pattern. Then I created a repository interface named ArtClassRepository within this package. This interface has method definitions for add, update, remove, and get class by ID methods. Then another interface named ReviewRepository with method definitions: add, update, remove, get AVG rating for teacher, and get AVG ratings by teachers. Also create the StudentRepository with methods: add, update, remove, get student by ID, get all students, and get students for day in it. And finally, an interface named TeacherRepository with methods: add, update, remove, get teacher by ID. After that, I've created implementation classes for these interfaces. The ArtClassRepositoryImpl class has implementations for the method add in it. I've written code to persist a given ArtClass entity instance. The update method has code to first…

Contents