Package org.openiam.esb.repository
Interface AuthStateRepository
-
- All Superinterfaces:
AuthStateRepositoryCustom
,org.springframework.data.repository.CrudRepository<AuthStateEntity,AuthStateId>
,org.springframework.data.jpa.repository.JpaRepository<AuthStateEntity,AuthStateId>
,org.springframework.data.jpa.repository.JpaSpecificationExecutor<AuthStateEntity>
,org.springframework.data.repository.PagingAndSortingRepository<AuthStateEntity,AuthStateId>
,org.springframework.data.repository.query.QueryByExampleExecutor<AuthStateEntity>
,org.springframework.data.repository.Repository<AuthStateEntity,AuthStateId>
@Repository public interface AuthStateRepository extends org.springframework.data.jpa.repository.JpaRepository<AuthStateEntity,AuthStateId>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<AuthStateEntity>, AuthStateRepositoryCustom
This is repository for working with AuthState- Author:
- Andrey Lezhebokov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deleteByContentProviderId(String contentProviderId)
void
deleteByUserId(String userId)
Delete record by userIdvoid
deleteOlderThan(Date olderThanDate)
Delete all auth state, where lastLogin field less than olderThanDate dateAuthStateEntity
findFirstByUserId(String userId)
use instead of findOne b/c PK is @EmbeddedIdList<String>
getUsedUserIPs(String userId)
void
updateAuthState(Date olderThanDate, BigDecimal state)
Set auth status for all auth_states with LAST_LOGIN date less than parameter "olderThanDate" date-
Methods inherited from interface org.openiam.esb.repository.custom.AuthStateRepositoryCustom
find, logoutByContentProvider
-
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save
-
Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getById, getOne, getReferenceById, saveAll, saveAllAndFlush, saveAndFlush
-
Methods inherited from interface org.springframework.data.jpa.repository.JpaSpecificationExecutor
count, exists, findAll, findAll, findAll, findOne
-
-
-
-
Method Detail
-
findFirstByUserId
@Query("SELECT a FROM AuthStateEntity a WHERE a.id.userId=:userId") AuthStateEntity findFirstByUserId(@Param("userId") String userId)
use instead of findOne b/c PK is @EmbeddedId- Parameters:
userId
-- Returns:
-
deleteByUserId
@Modifying @Query("DELETE FROM AuthStateEntity a WHERE a.id.userId=:userId") void deleteByUserId(@Param("userId") String userId)
Delete record by userId- Parameters:
userId
-
-
deleteByContentProviderId
@Modifying void deleteByContentProviderId(String contentProviderId)
-
getUsedUserIPs
@Query("SELECT ipAddress FROM AuthStateEntity a WHERE a.id.userId=:userId") List<String> getUsedUserIPs(@Param("userId") String userId)
-
deleteOlderThan
@Modifying @Query("DELETE FROM AuthStateEntity a WHERE a.lastLogin < :olderThanDate") void deleteOlderThan(@Param("olderThanDate") Date olderThanDate)
Delete all auth state, where lastLogin field less than olderThanDate date- Parameters:
olderThanDate
-
-
updateAuthState
@Modifying(clearAutomatically=true) @Query("UPDATE AuthStateEntity a SET a.authState=:state WHERE a.lastLogin < :olderThanDate") void updateAuthState(@Param("olderThanDate") Date olderThanDate, @Param("state") BigDecimal state)
Set auth status for all auth_states with LAST_LOGIN date less than parameter "olderThanDate" date
-
-