spring-projects / spring-petclinic

A sample Spring-based application
Apache License 2.0
7.79k stars 23.98k forks source link

Refactor to use JpaRepository default implement #1712

Closed wickdynex closed 2 weeks ago

wickdynex commented 2 weeks ago

Title:

Refactor to use JpaRepository default implement


Description:

This PR refactor the OwnerRepository, implementing with JpaRepository instead of Repository interface. Remove the rest @Query in OwnerRepository class. Also refactor code logic in test and controller files.


Problem:

Use JpaRepository can auto-generate query, so need to delete the annotations and also rename the method name, rebuild the code logic.


Solution:


Type of Change


Changes:


Local Test ScreenShot:

image

Additional Information:

This is just a part task to refactor the OwnerRepository with JpaRepository. Also need to do the same thing with VetRepository, but next step is to write more unit tests in PetControllerTests.