package com.oguerreiro.resilient.repository.security;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.oguerreiro.resilient.repository.ResilientJpaRepository;
import com.oguerreiro.resilient.security.resillient.SecurityGroupPermission;

/**
 * Spring Data JPA repository for the SecurityGroupPermission entity.
 */
@SuppressWarnings("unused")
@Repository
public interface SecurityGroupPermissionRepository extends ResilientJpaRepository<SecurityGroupPermission, Long> {
  @Query("""
      SELECT  s
      FROM    SecurityGroupPermission s
      WHERE   s.securityGroup.id=:securityGroupId
      ORDER BY s.securityResource.name
      """)
  List<SecurityGroupPermission> findBySecurityGroupId(@Param("securityGroupId") Long securityGroupId);
}
