Ambiguous method call in Intellij with JPA data Spring interface

I have an odd ambiguous method call error reported by intellij. I am using the JPA spring data interface, which also implements an interface with the same method signature:

UserRepository:

@Repository
public interface UserRepository extends CrudRepository<User, String>, UserProvider {
} 

UserProvider:

public interface UserProvider {
    User findOne(String userId);
}

The reasons for the need for a second interface aside, I suggested that since these are the interfaces and the method signatures for findOne are the same, the compiler will not have problems with ambiguity. I do not understand Java rights, or is it an intellij problem? Is this a problem with resolving the CrudRepository interface via generics?

+4
source share
1 answer

. , IDE (Eclipse), Maven testCompile.

, Java, Eclipse Maven, , , JDK (jdk1.8.0_91).

, , , , @RepositoryDefinition , CrudRepository. , :

@RepositoryDefinition(domainClass = User.class, idClass = String.class)
public interface UserRepository extends UserProvider {
}
+1

Source: https://habr.com/ru/post/1624183/


All Articles