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 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)
      • findByAssociatedFile

        @Query("select game from Game game where game.traceFile = ?1 or game.stateFile = ?1 or game.seedFile = ?1 or game.configFile = ?1 or game.bootFile = ?1 or game.weatherFile = ?1")
        List<Game> findByAssociatedFile​(File file)