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
-
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 class com.logicaldoc.core.HibernatePersistentObjectDAO
bulkUpdate, delete, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, getSessionFactory, initialize, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, 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, 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
-
findByUserId
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 gridRecord, if any
- Throws:
PersistenceException
- Error in the database
-