CommentRepository.java
645 Bytes
package fr.plil.sio.examen.repositories;
import fr.plil.sio.examen.api.Animal;
import fr.plil.sio.examen.api.Comment;
import fr.plil.sio.examen.api.Owner;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* TODO: complete this interface for new find methods.
*/
public interface CommentRepository extends JpaRepository<Comment, Long>{
/**
* List all messages about an animal
*/
List<Comment> findByAnimal(Animal animal);
/**
* List all messages reported by one owner
*/
List<Comment> findByReporter(Owner reporter);
}