spring-data-jpa-entity-graph icon indicating copy to clipboard operation
spring-data-jpa-entity-graph copied to clipboard

Fix: Added super to calls in repo implementation.

Open SteelLiras opened this issue 2 years ago • 1 comments

I am developing a set of custom spring repos with soft delete logic based on auth context and request params. I wanted to make the system consistent, so just like in your repo I created a custom repo factory bean, custom repo interfaces (overriding all standard JPA repos and EntityGraph repos) and one implementation file with all methods overwritten from the following: CrudRepository, SortingAndPagingRepository, JpaRepository, ByExampleExecutor, JpaSpecificationExecutor + all the methods from EntityGraph versions of repos.

My SoftDeleteRepoImpl FindAll had additional showDeleted boolean param and it called your FindAll method with EntityGraph param in the implementation. The problem I ran into was that my FindAll implementation was calling your FindAll as expected, but your FindAll was calling another signature from my implementation again, which added the soft delete logic twice in an inconsistent way. The fix was to add super to the calls you do under the hood in your repo implementation.

If this is an acceptable change, please accept the PR.

SteelLiras avatar May 24 '23 20:05 SteelLiras

I don’t entirely understand your usecase. Can you please provide some code snippets to help me understand?

reda-alaoui avatar May 24 '23 21:05 reda-alaoui