io.mosip.pms.common.repository.MispLicenseRepository Maven / Gradle / Ivy
package io.mosip.pms.common.repository;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import io.mosip.pms.common.entity.MISPLicenseEntity;
/**
*
* @author Nagarjuna Kuchi
* @version 1.0
*
* Defines an object to provide misp license data base related operations.
*/
@Repository
public interface MispLicenseRepository extends JpaRepository {
@Query(value = "select * from misp_license ml where ml.license_key=?", nativeQuery = true)
MISPLicenseEntity findByLicensekey(String licenseKey);
@Query(value = "select * from misp_license ml where ml.misp_id=?", nativeQuery = true)
List findByMispId(String mispId);
@Query(value = "select * from misp_license ml where ml.misp_id=? and ml.valid_to_date > now() and (ml.is_deleted is null or ml.is_deleted = false) and ml.is_active = true", nativeQuery = true)
List findByMispIdandExpirydate(String mispId);
@Query(value = "select * from misp_license ml where ml.misp_id = ?1 and ml.license_key=?2", nativeQuery = true)
MISPLicenseEntity findByIdAndKey(String id, String licenseKey);
@Query(value = "select * from misp_license ml where ml.misp_id=? and (ml.is_deleted is null or ml.is_deleted = false) and ml.is_active = true", nativeQuery = true)
List findByMispIdAndIsActive(String mispId);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy