Interface AuthStateRepository

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void deleteByContentProviderId​(String contentProviderId)  
      void deleteByUserId​(String userId)
      Delete record by userId
      void deleteOlderThan​(Date olderThanDate)
      Delete all auth state, where lastLogin field less than olderThanDate date
      AuthStateEntity findFirstByUserId​(String userId)
      use instead of findOne b/c PK is @EmbeddedId
      List<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.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
      • Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

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

        count, exists, findAll, findBy, 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