package de.szut.casino.user;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
public interface UserRepository extends JpaRepository<UserEntity, Long> {
    @Query("SELECT u FROM UserEntity u WHERE u.keycloakId = ?1")
    Optional<UserEntity> findOneByKeycloakId(String keycloakId);

    boolean existsByKeycloakId(String keycloakId);
}
