Package com.logicaldoc.core.security.dao
Class HibernatePasswordHistoryDAO
- java.lang.Object
-
- com.logicaldoc.core.HibernatePersistentObjectDAO<PasswordHistory>
-
- com.logicaldoc.core.security.dao.HibernatePasswordHistoryDAO
-
- All Implemented Interfaces:
PersistentObjectDAO<PasswordHistory>
,PasswordHistoryDAO
public class HibernatePasswordHistoryDAO extends HibernatePersistentObjectDAO<PasswordHistory> implements PasswordHistoryDAO
Hibernate implementation ofPasswordHistoryDAO
- Since:
- 8.6.1
- Author:
- Marco Meschieri - LogicalDOC
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanOldHistories(long userId, int retain)
This method deletes all the histories maintaining the most recent ones.List<PasswordHistory>
findByUserId(long userId, Integer max)
Gets all the histories related to a given user ordered by date descPasswordHistory
findByUserIdAndPassword(long userId, String password, int max)
Gets the password used by the user in last max times-
Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO
bulkUpdate, delete, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, getSessionFactory, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForObject, queryForRowSet, queryForString, setSessionFactory, store
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.logicaldoc.core.PersistentObjectDAO
bulkUpdate, delete, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForObject, queryForRowSet, queryForString, store
-
-
-
-
Method Detail
-
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 interfacePasswordHistoryDAO
- Parameters:
userId
- Identifier of the usermax
- 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. Ifretain
is 0 or -1, the cancellation is not made.- Specified by:
cleanOldHistories
in interfacePasswordHistoryDAO
- Parameters:
userId
- identifier of the userretain
- 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 interfacePasswordHistoryDAO
- Parameters:
userId
- Identifier of the userpassword
- The password to checkmax
- number of most recent records to evaluate- Returns:
- the found history record, if any
- Throws:
PersistenceException
- Error in the database
-
-