Add Custom Method to JPARepository with Generics
问题 Assume I have a Entity called Product . I design a Repo as @Repository interface ProductRepository implements JPARepository<Product, Integer>{} This would inherit all the default methods such as save, findAll etc; Now I want to have one custom method, which is also a common method for other entities. I added another interface and implementation interface CustomRepository<T,ID>{ public void customMethod() } class CustomRepositoryImpl implements CustomRepository<T,ID>{ public void customMethod(