Interface RelationPermissionsRepository

  • All Superinterfaces:
    org.springframework.data.repository.CrudRepository<RelationPermissions,​java.util.UUID>, org.springframework.data.jpa.repository.JpaRepository<RelationPermissions,​java.util.UUID>, org.springframework.data.repository.PagingAndSortingRepository<RelationPermissions,​java.util.UUID>, org.springframework.data.repository.query.QueryByExampleExecutor<RelationPermissions>, org.springframework.data.repository.Repository<RelationPermissions,​java.util.UUID>

    @Repository
    public interface RelationPermissionsRepository
    extends org.springframework.data.jpa.repository.JpaRepository<RelationPermissions,​java.util.UUID>
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.Optional<RelationPermissions> findByProviderAndSubscriber​(Users provider, Users subscriber)
      Find a list of RelationPermissions that the given provider granted to the subscriber.
      java.util.Optional<RelationPermissions> findByProviderAndSubscriberAndPermission​(Users provider, Users subscriber, Permissions permission)
      Finds the RelationPermissions object from the given permissions the given provider and the subscriber.
      • Methods inherited from interface org.springframework.data.repository.CrudRepository

        count, delete, deleteAll, deleteAll, deleteById, existsById, findById, save
      • Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

        deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getOne, saveAll, saveAndFlush
      • Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

        findAll
      • Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

        count, exists, findAll, findOne
    • Method Detail

      • findByProviderAndSubscriber

        java.util.Optional<RelationPermissions> findByProviderAndSubscriber​(Users provider,
                                                                            Users subscriber)
        Find a list of RelationPermissions that the given provider granted to the subscriber.
        Parameters:
        provider - the provider
        subscriber - the subscriber
        Returns:
        an optional with the entry if found
      • findByProviderAndSubscriberAndPermission

        @Transactional
        @Query("select rp from RelationPermissions rp where rp.provider = :provider and rp.subscriber = :subscriber and :permission in (rp.permissions)")
        java.util.Optional<RelationPermissions> findByProviderAndSubscriberAndPermission​(@Param("provider")
                                                                                         Users provider,
                                                                                         @Param("subscriber")
                                                                                         Users subscriber,
                                                                                         @Param("permission")
                                                                                         Permissions permission)
        Finds the RelationPermissions object from the given permissions the given provider and the subscriber.
        Parameters:
        provider - the provider
        subscriber - the subscriber
        permission - the permission
        Returns:
        an optional with the entry if found