Class HibernatePasswordHistoryDAO

java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<PasswordHistory>
com.logicaldoc.core.security.user.HibernatePasswordHistoryDAO
All Implemented Interfaces:
PersistentObjectDAO<PasswordHistory>, PasswordHistoryDAO

public class HibernatePasswordHistoryDAO extends HibernatePersistentObjectDAO<PasswordHistory> implements PasswordHistoryDAO
Hibernate implementation of PasswordHistoryDAO
Since:
8.6.1
Author:
Marco Meschieri - LogicalDOC
  • Method Details

    • findByUserId

      public List<PasswordHistory> findByUserId(long userId, Integer max) throws PersistenceException
      Description copied from interface: PasswordHistoryDAO
      Gets all the histories related to a given user ordered by date desc
      Specified by:
      findByUserId in interface PasswordHistoryDAO
      Parameters:
      userId - Identifier of the user
      max - maximum number of returned records
      Returns:
      orderer list of histories
      Throws:
      PersistenceException - Error in the database
    • cleanOldHistories

      public void cleanOldHistories(long userId, int retain)
      Description copied from interface: PasswordHistoryDAO
      This method deletes all the histories maintaining the most recent ones. If retain is 0 or -1, the cancellation is not made.
      Specified by:
      cleanOldHistories in interface PasswordHistoryDAO
      Parameters:
      userId - identifier of the user
      retain - the number of most recent histories to maintain
    • findByUserIdAndPassword

      public PasswordHistory findByUserIdAndPassword(long userId, String password, int max) throws PersistenceException
      Description copied from interface: PasswordHistoryDAO
      Gets the password used by the user in last max times
      Specified by:
      findByUserIdAndPassword in interface PasswordHistoryDAO
      Parameters:
      userId - Identifier of the user
      password - The password to check
      max - number of most recent records to evaluate
      Returns:
      the found history gridRecord, if any
      Throws:
      PersistenceException - Error in the database