Interface GameRepository

  • All Superinterfaces:
    org.springframework.data.repository.CrudRepository<Game,​java.lang.Long>, org.springframework.data.repository.Repository<Game,​java.lang.Long>

    @Repository
    public interface GameRepository
    extends org.springframework.data.repository.CrudRepository<Game,​java.lang.Long>
    • Method Detail

      • findFirstByCurrentState

        java.util.Optional<Game> findFirstByCurrentState​(GameState state)
      • findByIdAndPlayer

        @Query(value="SELECT DISTINCT * FROM game g INNER JOIN game_player gp ON gp.game_id = g.game_id WHERE g.game_id = :gameId AND gp.player_id = :playerId",
               nativeQuery=true)
        java.util.Optional<Game> findByIdAndPlayer​(long gameId,
                                                   long playerId)