io.mosip.admin.bulkdataupload.repositories.TitleRepository Maven / Gradle / Ivy
package io.mosip.admin.bulkdataupload.repositories;
import java.util.List;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import io.mosip.admin.bulkdataupload.entity.Title;
import io.mosip.admin.bulkdataupload.entity.id.CodeAndLanguageCodeID;
import io.mosip.kernel.core.dataaccess.spi.repository.BaseRepository;
/**
* Repository class for fetching titles from master db
*
* @author Sidhant Agarwal
* @since 1.0.0
*
*/
@Repository
public interface TitleRepository extends BaseRepository {
/**
* method to get titles for a particular language code
*
* @param languageCode input from user
* @return list of all titles for a particular language code
*/
@Query
List getThroughLanguageCode(@Param("lang_code") String languageCode);
/**
* method to find title data by input code
*
* @param code input from user
* @return title data for the corresponding code entered
*/
@Query("FROM Title WHERE code =?1 AND (isDeleted is null OR isDeleted = false) and isActive = true")
List findByCode(String code);
}