AnimalRepository.java 636 Bytes
package fr.plil.sio.examen.repositories;

import fr.plil.sio.examen.api.Animal;
import fr.plil.sio.examen.api.Owner;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;

public interface AnimalRepository extends JpaRepository<Animal,Long> {

    /**
     * NOTE: this is an important example to help you with the findByXXX methods
     * in the comment repository (hint: findByName works with a String, what
     * about other kind of object ?).
     */
    List<Animal> findByOwner(Owner owner);
    
    List<Animal> findByName(String name);
    
//    Animal findById(Long id);
}