ch.inftec.ju.testing.db.data.repo.PlayerRepo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ju-testing Show documentation
Show all versions of ju-testing Show documentation
Contains helping classes for Unit Testing
package ch.inftec.ju.testing.db.data.repo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import ch.inftec.ju.testing.db.data.entity.Player;
/**
* Spring data CrudRepository for the Player entity.
* @author Martin
*
*/
public interface PlayerRepo extends JpaRepository {
/*
* EclipseLink has a problem when the query should be created dynamically. When
* we explicitly define the query, we don't have this problem.
* Hibernate seems to work in both cases.
*/
@Query("select p from Player p where p.lastName = ?1")
Player getByLastName(String name);
}