Package energy.eddie.aiida.repositories
Interface PermissionRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Permission,,UUID> org.springframework.data.jpa.repository.JpaRepository<Permission,,UUID> org.springframework.data.repository.ListCrudRepository<Permission,,UUID> org.springframework.data.repository.ListPagingAndSortingRepository<Permission,,UUID> org.springframework.data.repository.PagingAndSortingRepository<Permission,,UUID> org.springframework.data.repository.query.QueryByExampleExecutor<Permission>,org.springframework.data.repository.Repository<Permission,UUID>
public interface PermissionRepository
extends org.springframework.data.jpa.repository.JpaRepository<Permission,UUID>
-
Method Summary
Modifier and TypeMethodDescriptionReturns a list of all active permission, i.e.findByUserIdOrderByGrantTimeDesc(UUID userId) Returns all permission objects for the given userId, sorted by their grantTime descending.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findByUserIdOrderByGrantTimeDesc
Returns all permission objects for the given userId, sorted by their grantTime descending.- Returns:
- A list of permissions, sorted by grantTime descending, i.e. the permission with the newest grantTime is the first item.
-
findAllActivePermissions
@Query("SELECT p FROM Permission p WHERE p.status IN (energy.eddie.aiida.models.permission.PermissionStatus.WAITING_FOR_START, energy.eddie.aiida.models.permission.PermissionStatus.STREAMING_DATA)") List<Permission> findAllActivePermissions()Returns a list of all active permission, i.e. all permissions, whose status is eitherPermissionStatus.ACCEPTEDorPermissionStatus.WAITING_FOR_STARTorPermissionStatus.STREAMING_DATA.- Returns:
- A list of permissions that have the status
PermissionStatus.ACCEPTEDorPermissionStatus.WAITING_FOR_STARTorPermissionStatus.STREAMING_DATA.
-