package com.cirle.scientific.questionnaire.repository;

import com.cirle.scientific.questionnaire.entity.QuestionEntity;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface QuestionRepository extends CrudRepository<QuestionEntity, String> {

    @Query("SELECT type FROM QuestionEntity WHERE id = ?1")
    Optional<QuestionEntity.Type> findTypeById(String id);

}
