Reactive Repository MongoDB not finding methods

Trying to use Reactive programming in a web app, but it seems that Intellij doesn't find any other method than my findAllBy in my repository, I mean crud methods, isn't it integrated to it ?
public interface CocktailRepository extends ReactiveSortingRepository<Cocktail, String>{
Flux<Cocktail> findAllBy(Pageable pageable);
}
public interface CocktailRepository extends ReactiveSortingRepository<Cocktail, String>{
Flux<Cocktail> findAllBy(Pageable pageable);
}
@GetMapping("/cocktails")
public Mono<Page<Cocktail>> getAllCocktails(Pageable pageable) {
return cocktailRepository.findAllBy(pageable)
.collectList()
.zipWith(cocktailRepository.count())
.map(c -> new PageImpl<>(c.getT1(), pageable, c.getT2()));
}
@GetMapping("/cocktails")
public Mono<Page<Cocktail>> getAllCocktails(Pageable pageable) {
return cocktailRepository.findAllBy(pageable)
.collectList()
.zipWith(cocktailRepository.count())
.map(c -> new PageImpl<>(c.getT1(), pageable, c.getT2()));
}
In Spring documentation: https://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data/repository/reactive/ReactiveSortingRepository.html It says : In many cases it should be combined with ReactiveCrudRepository or a similar repository interface in order to add CRUD functionality. Does that mean that I have to create another repository for CRUD operations and use the Sorting one only for pagination ?
ReactiveSortingRepository (Spring Data Core 3.2.2 API)
declaration: package: org.springframework.data.repository.reactive, interface: ReactiveSortingRepository
2 Replies
JavaBot
JavaBot11mo ago
This post has been reserved for your question.
Hey @Santo! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
JavaBot
JavaBot11mo ago
Post Closed
This post has been closed by <@231028402025529344>.
Want results from more Discord servers?
Add your server