Package africa.absa.inception.security
Interface UserDirectoryRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<UserDirectory,,UUID> org.springframework.data.jpa.repository.JpaRepository<UserDirectory,,UUID> org.springframework.data.repository.PagingAndSortingRepository<UserDirectory,,UUID> org.springframework.data.repository.query.QueryByExampleExecutor<UserDirectory>,org.springframework.data.repository.Repository<UserDirectory,UUID>
public interface UserDirectoryRepository
extends org.springframework.data.jpa.repository.JpaRepository<UserDirectory,UUID>
The UserDirectoryRepository interface declares the repository for the
UserDirectory domain type.
- Author:
- Marcus Portmann
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteById(UUID userDirectoryId) Delete the user directory.booleanexistsByNameIgnoreCase(String name) Check whether the user directory with the specified name exists.org.springframework.data.domain.Page<UserDirectory>findAll(org.springframework.data.domain.Pageable pageable) Retrieve the user directories.findAllByTenantId(UUID tenantId) Retrieve the user directories for the tenant.org.springframework.data.domain.Page<UserDirectory>findFiltered(String filter, org.springframework.data.domain.Pageable pageable) Retrieve the filtered user directories.getNameById(UUID userDirectoryId) Retrieve the name of the user directory.getTenantIdsById(UUID userDirectoryId) Retrieve the IDs for the tenants for the user directory.getTypeForUserDirectoryById(UUID userDirectoryId) Retrieve the type for the user directory.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getById, getOne, saveAll, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findOne
-
Method Details
-
deleteById
@Modifying @Query("delete from UserDirectory ud where ud.id = :userDirectoryId") void deleteById(@Param("userDirectoryId") UUID userDirectoryId) Delete the user directory.- Specified by:
deleteByIdin interfaceorg.springframework.data.repository.CrudRepository<UserDirectory,UUID> - Parameters:
userDirectoryId- the ID for the user directory
-
existsByNameIgnoreCase
Check whether the user directory with the specified name exists.- Parameters:
name- the name of the user directory- Returns:
- true if a user directory with the specified name exists or false otherwise
-
findAll
org.springframework.data.domain.Page<UserDirectory> findAll(org.springframework.data.domain.Pageable pageable) Retrieve the user directories.- Specified by:
findAllin interfaceorg.springframework.data.repository.PagingAndSortingRepository<UserDirectory,UUID> - Parameters:
pageable- the pagination information- Returns:
- the user directories
-
findAllByTenantId
@Query("select ud from UserDirectory ud join ud.tenants as o where o.id = :tenantId") List<UserDirectory> findAllByTenantId(@Param("tenantId") UUID tenantId) Retrieve the user directories for the tenant.- Parameters:
tenantId- the ID for the tenant- Returns:
- the user directories for the tenant
-
findFiltered
@Query("select ud from UserDirectory ud where (lower(ud.name) like lower(:filter))") org.springframework.data.domain.Page<UserDirectory> findFiltered(String filter, org.springframework.data.domain.Pageable pageable) Retrieve the filtered user directories.- Parameters:
filter- the filter to apply to the user directoriespageable- the pagination information- Returns:
- the filtered user directories
-
getNameById
@Query("select ud.name from UserDirectory ud where ud.id = :userDirectoryId") Optional<String> getNameById(@Param("userDirectoryId") UUID userDirectoryId) Retrieve the name of the user directory.- Parameters:
userDirectoryId- the ID for the user directory- Returns:
- an Optional containing the name of the user directory or an empty Optional if the user directory could not be found
-
getTenantIdsById
@Query("select o.id from Tenant o join o.userDirectories as ud where ud.id = :userDirectoryId") List<UUID> getTenantIdsById(@Param("userDirectoryId") UUID userDirectoryId) Retrieve the IDs for the tenants for the user directory.- Parameters:
userDirectoryId- the ID for the user directory- Returns:
- the IDs for the tenants for the user directory
-
getTypeForUserDirectoryById
@Query("select ud.type from UserDirectory ud where ud.id = :userDirectoryId") Optional<String> getTypeForUserDirectoryById(@Param("userDirectoryId") UUID userDirectoryId) Retrieve the type for the user directory.- Parameters:
userDirectoryId- the ID for the user directory- Returns:
- an Optional containing the type for the user directory or an empty Optional if the user directory could not be found
-