Skip to content

Instantly share code, notes, and snippets.

@ereshzealous
Created January 17, 2020 07:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ereshzealous/f8f221fd1cbbb45f79cccbb101591376 to your computer and use it in GitHub Desktop.
Save ereshzealous/f8f221fd1cbbb45f79cccbb101591376 to your computer and use it in GitHub Desktop.
package com.eresh.spring.persistence.repository;
import com.eresh.spring.persistence.entity.Author;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.Query;
import org.springframework.data.mongodb.repository.ReactiveMongoRepository;
import org.springframework.stereotype.Repository;
/**
* Created By Gorantla, Eresh on 12/Dec/2019
**/
@Repository
public interface AuthorRepository extends ReactiveMongoRepository<Author, String> {
Mono<Author> findByIdAndDeleteIsFalse(String id);
Flux<Author> findByGender(String gender);
Flux<Author> findByFirstName(String name);
Flux<Author> findByFirstNameContainsIgnoreCase(String name);
@Query("{ id: { $exists: true }}")
Flux<Author> retrieveAllAuthors(final Pageable page);
Mono<Long> countByFirstNameContainsIgnoreCase(String firstName);
Flux<Author> findByFirstNameContainsIgnoreCase(String firstName, Pageable pageable);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment