io.mosip.admin.bulkdataupload.repositories.ApplicationRepository Maven / Gradle / Ivy
package io.mosip.admin.bulkdataupload.repositories;
import java.util.List;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import io.mosip.kernel.core.dataaccess.spi.repository.BaseRepository;
import io.mosip.admin.bulkdataupload.entity.Application;
/**
* @author Neha
* @since 1.0.0
*
*/
@Repository
public interface ApplicationRepository extends BaseRepository {
/**
* Get all Application types
*
* @param entityClass of type {@link Application}
* @return list of {@link Application}
*/
@Query("FROM Application where (isDeleted is null OR isDeleted = false) AND isActive = true")
List findAllByIsDeletedFalseOrIsDeletedNull(Class entityClass);
/**
*
* Get all Application types of a specific language using language code
*
* @param languageCode of type {@link String}
* @return list of {@link Application}
*/
@Query("FROM Application WHERE langCode =?1 AND (isDeleted is null OR isDeleted = false)AND isActive = true")
List findAllByLangCodeAndIsDeletedFalseOrIsDeletedIsNull(String languageCode);
/**
* Get Application type by specific id and language code
*
* @param code -code
* @param languageCode - language code
* @return {@link Application}
*/
@Query("FROM Application WHERE code =?1 AND langCode =?2 AND (isDeleted is null OR isDeleted = false) AND isActive = true")
Application findByCodeAndLangCodeAndIsDeletedFalseOrIsDeletedIsNull(String code, String languageCode);
}