Reputation: 13113
How to extend interfaces CrudRepository<T, ID>
, MongoRepository<T, ID>
, PagingAndSortingRepository<T, ID>
into BaseRepository<T, ID>
? (if possible)
I want to have access methods of three interfaces.
I've tried:
@SuppressWarnings("rawtypes")
public interface BaseRepositoryDao<T, ID> extends CrudRepository,
MongoRepository, PagingAndSortingRepository {
}
How can I achieve that?
EDIT:
MongoRepository
already extends PagingAndSortingRepository
Upvotes: 2
Views: 285
Reputation: 61198
A MongoRepostory
is a CrudRepository
and a PagingAndSortingRepository
so the following is sufficient:
public interface BaseRepositoryDao<T, ID extends Serializable> extends MongoRepository<T, ID> {
}
Upvotes: 1