package com.alterdekim.game.repository;

import com.alterdekim.game.entity.Postcard;
import com.alterdekim.game.entity.Preloader;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface PreloaderRepository extends JpaRepository<Preloader, Long> {
    Optional<Preloader> findById(Long id);

    List<Preloader> findAll();

    @Query("SELECT p FROM Preloader p WHERE p.isSelected = true")
    List<Preloader> findSelected();
}