Interface PasswordHistoryDAO
- All Superinterfaces:
PersistentObjectDAO<PasswordHistory>
- All Known Implementing Classes:
HibernatePasswordHistoryDAO
This class is a DAO-service for PasswordHistory-objects.
- Since:
- 8.6.1
- Author:
- Marco Meschieri - LogicalDOC
-
Field Summary
Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO
ENTITY
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanOldHistories
(long userId, int retain) This method deletes all the histories maintaining the most recent ones.findByUserId
(long userId, Integer max) Gets all the histories related to a given user ordered by date descfindByUserIdAndPassword
(long userId, String password, int max) Gets the password used by the user in last max timesMethods inherited from interface com.logicaldoc.core.PersistentObjectDAO
bulkUpdate, delete, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, initialize, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, store
-
Method Details
-
findByUserIdAndPassword
PasswordHistory findByUserIdAndPassword(long userId, String password, int max) throws PersistenceException Gets the password used by the user in last max times- Parameters:
userId
- Identifier of the userpassword
- The password to checkmax
- number of most recent records to evaluate- Returns:
- the found history gridRecord, if any
- Throws:
PersistenceException
- Error in the database
-
findByUserId
Gets all the histories related to a given user ordered by date desc- Parameters:
userId
- Identifier of the usermax
- maximum number of returned records- Returns:
- orderer list of histories
- Throws:
PersistenceException
- Error in the database
-
cleanOldHistories
void cleanOldHistories(long userId, int retain) This method deletes all the histories maintaining the most recent ones. Ifretain
is 0 or -1, the cancellation is not made.- Parameters:
userId
- identifier of the userretain
- the number of most recent histories to maintain
-