io.mosip.pms.common.repository.AuthPolicyRepository 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 org.springframework.data.repository.query.Param;
import io.mosip.pms.common.entity.AuthPolicy;
@Repository
public interface AuthPolicyRepository extends JpaRepository{
@Query(value = "select * from auth_policy ap where ap.policy_group_id=?1 and ap.name = ?2",nativeQuery = true)
AuthPolicy findByPolicyGroupIdAndName(String policyGroupId, String name);
@Query(value = "select * from auth_policy ap where ap.policy_group_id=?1 and ap.id = ?2",nativeQuery = true)
AuthPolicy findByPolicyGroupAndId(String policyGroupId, String policyId);
@Query(value = "select * from auth_policy ap where ap.policy_group_id=?", nativeQuery = true)
List findByPolicyGroupId(String policyId);
AuthPolicy findByName(String name);
@Query(value = "select * from auth_policy ap where ap.id IN :policyIds and (ap.is_deleted is null or ap.is_deleted = false) and ap.is_active = true",nativeQuery = true)
List findByPolicyIds(@Param("policyIds") List policyIds);
@Query(value = "select * from auth_policy ap where ap.id IN :policyIds",nativeQuery = true)
List findAllByPolicyIds(@Param("policyIds") List policyIds);
@Query(value = "select * from auth_policy ap where ap.policy_group_id=? and (ap.is_deleted is null or ap.is_deleted = false) and ap.is_active = true",nativeQuery = true)
List findActivePoliciesByPolicyGroupId(String policyGroupId);
@Query(value = "select * from auth_policy ap where ap.name=? and (ap.is_deleted is null or ap.is_deleted = false) and ap.is_active = true",nativeQuery = true)
AuthPolicy findByPolicyName(String policyName);
@Query(value="select * from auth_policy ap where lower(ap.name) like lower(concat('%', concat(?1, '%')))", nativeQuery = true)
List findByNameIgnoreCase(String name);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy