Interface GameRepository
- 
- All Superinterfaces:
 org.springframework.data.repository.CrudRepository<Game,Long>,org.springframework.data.jpa.repository.JpaRepository<Game,Long>,org.springframework.data.repository.PagingAndSortingRepository<Game,Long>,org.springframework.data.repository.query.QueryByExampleExecutor<Game>,org.springframework.data.repository.Repository<Game,Long>
public interface GameRepository extends org.springframework.data.jpa.repository.JpaRepository<Game,Long>
Spring Data JPA repository for the Game entity. 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<Game>findByAssociatedFile(File file)List<Game>findByNameAndType(String login, String name, GameType type)List<Game>findByNameAndType(String name, GameType type)List<Game>findByOwnerIsCurrentUser()List<Game>findByOwnerIsCurrentUserOrShared()List<Game>findByOwnerIsCurrentUserOrShared(String login)- 
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteById, existsById, findById, save 
- 
Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getOne, saveAll, saveAndFlush 
 - 
 
 - 
 
- 
- 
Method Detail
- 
findByOwnerIsCurrentUser
@Query("select game from Game game where game.owner.login = ?#{principal.username}") List<Game> findByOwnerIsCurrentUser() 
- 
findByOwnerIsCurrentUserOrShared
@Query("select game from Game game where game.owner.login = ?#{principal.username} or game.shared = TRUE") List<Game> findByOwnerIsCurrentUserOrShared() 
- 
findByOwnerIsCurrentUserOrShared
@Query("select game from Game game where game.shared = TRUE or game.owner.login = :login") List<Game> findByOwnerIsCurrentUserOrShared(@Param("login") String login) 
- 
findByNameAndType
@Query("select game from Game game where (game.owner.login = ?#{principal.username} or game.shared = TRUE) and game.name = ?1 and game.type = ?2") List<Game> findByNameAndType(String name, GameType type) 
- 
findByNameAndType
@Query("select game from Game game where (game.shared = TRUE or game.owner.login = :login) and game.name = :name and game.type = :type") List<Game> findByNameAndType(@Param("login") String login, @Param("name") String name, @Param("type") GameType type) 
 - 
 
 -