package es.uv.garcosda.repositories;


import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.repository.reactive.ReactiveCrudRepository;

import es.uv.garcosda.domain.Document;
import reactor.core.publisher.Flux;

public interface NewsRepository extends ReactiveCrudRepository<Document, Integer>{

	public Flux<Document> findByAuthor(String author);
	public Flux<Document> findByPublisher(String publisher);
	@Query("select distinct n.author from Document n")
    public Flux<String> findAuthors();
    @Query("select distinct n.publisher from Document n")
    public Flux<String> findPublishers(); 
	
}
