All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.mosip.kernel.masterdata.repository.ApplicationRepository Maven / Gradle / Ivy

There is a newer version: 1.2.1.0
Show newest version
package io.mosip.kernel.masterdata.repository;

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.kernel.masterdata.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);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy