Java 将crudepository接口扩展到基接口

Java 将crudepository接口扩展到基接口,java,interface,spring-data-jpa,Java,Interface,Spring Data Jpa,如何将接口crudepository,MongoRepository,paging和sortingrepository扩展到BaseRepository?(如有可能) 我想有三个接口的访问方法 我试过: @SuppressWarnings("rawtypes") public interface BaseRepositoryDao<T, ID> extends CrudRepository, MongoRepository, PagingAndSortingRepos

如何将接口
crudepository
MongoRepository
paging和sortingrepository
扩展到
BaseRepository
?(如有可能)

我想有三个接口的访问方法

我试过:

@SuppressWarnings("rawtypes")
public interface BaseRepositoryDao<T, ID> extends CrudRepository,
        MongoRepository, PagingAndSortingRepository {

}
@SuppressWarnings(“rawtypes”)
公共接口BaseRepositoryDao扩展了CrudeRepository,
MongoRepository、Paging和SortingRepository{
}
我怎样才能做到这一点

编辑:

MongoRepository
已经扩展了
PagingAndSortingRepository
A是
crudepository
PagingAndSortingRepository
,因此以下内容就足够了:

public interface BaseRepositoryDao<T, ID extends Serializable> extends MongoRepository<T, ID> {

}
公共接口BaseRepositoryDao扩展了MongoRepository{
}

那么问题是什么?这和我的答案有什么不同吗?@bot你的答案是非常错误的。还是有点错,,因为它忽略了类型约束。我想我可能是错的,但是你能详细说明一下它忽略了什么类型参数吗?
MongoRespository
中的@bot
ID
需要
扩展可序列化的
接口,因此
扩展MongoRespository
的泛型
接口必须具有相同的类型约束
ID
。我不知道有这样的限制。在这种情况下,我确实站得住脚。