Browse Source
Supposed you have a base repository interface declaring a method:
interface BaseRepository<T, ID extends Serializable> extends Repository<T, ID> {
T myGenericMethod();
}
as well as a concrete repository redeclaring this method to annotate a query on it:
interface ConcreteRepository extends BaseRepository<User, Long> {
@Query("…")
User myGenericMethod()
}
Until now we both returned the intermediate method as well as the concrete one which might cause failures as in this case a query derivation would be attempted for the intermediate method which will fail for obvious reasons. The fix now starts with looking up the most specific method when iterating over the repository's methods which causes the intermediate method to be skipped in case it was overridden.
pull/14/head
2 changed files with 21 additions and 2 deletions
Loading…
Reference in new issue