package com.dbnt.faisp.main.translator.repository;

import com.dbnt.faisp.main.translator.model.Translator;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;



public interface TranslatorRepository extends JpaRepository<Translator, Translator.TranslatorId> {

	Translator findFirstByOrderByTranslatorKeyDesc();

	void deleteByTranslatorKey(int trKey);
	
	@Query(value = "SELECT tr_name FROM translator_info WHERE translator_key=:translatorKey order by version_no desc limit 1", nativeQuery = true)
	String getTrLastName(@Param("translatorKey") Integer translatorKey);




}
