Package com.logicaldoc.core.security.dao
Interface UserHistoryDAO
- All Superinterfaces:
PersistentObjectDAO<UserHistory>
- All Known Implementing Classes:
HibernateUserHistoryDAO
DAO for
UserHistory
handling.- Since:
- 5.0
- Author:
- Matteo Caruso - LogicalDOC
-
Field Summary
Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO
ENTITY
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanOldHistories
(int ttl) This method deletes all the user history entries oldest than the given days from now.Creates an user history entryfindByUserId
(long userId) This method selects all histories of a given user.findByUserIdAndEvent
(long userId, String event) This method selects all histories of a given user and a given type.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, getDatabaseMetadata, getDbms, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForRowSet, queryForString, store
-
Method Details
-
findByUserId
This method selects all histories of a given user.- Parameters:
userId
- identifier of the suer- Returns:
- list of histories ordered by date asc
-
findByUserIdAndEvent
This method selects all histories of a given user and a given type.- Parameters:
userId
- identifier of the suerevent
- The event specification to restrict the search (optional)- Returns:
- list of histories ordered by date asc
-
createUserHistory
UserHistory createUserHistory(User user, String event, String comment, String sessionId, Client client) Creates an user history entry- Parameters:
user
- The user that made the operationevent
- The event specificationcomment
- The comment provided by the userclient
- The client connected to LogicalDOCsessionId
- The user session id- Returns:
- the created history
-
cleanOldHistories
void cleanOldHistories(int ttl) This method deletes all the user history entries oldest than the given days from now. Ifttl
is 0 or -1, the cancellation is not made.- Parameters:
ttl
- The maximum number of days over which the history is considered old
-