Class HibernateUserHistoryDAO
java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<UserHistory>
com.logicaldoc.core.history.HibernateHistoryDAO<UserHistory>
com.logicaldoc.core.security.user.HibernateUserHistoryDAO
- All Implemented Interfaces:
PersistentObjectDAO<UserHistory>
,UserHistoryDAO
public class HibernateUserHistoryDAO
extends HibernateHistoryDAO<UserHistory>
implements UserHistoryDAO
-
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 class com.logicaldoc.core.history.HibernateHistoryDAO
store
Methods 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
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:UserHistoryDAO
This method selects all histories of a given user.- Specified by:
findByUserId
in interfaceUserHistoryDAO
- Parameters:
userId
- identifier of the suer- Returns:
- list of histories ordered by date asc
-
findByUserIdAndEvent
Description copied from interface:UserHistoryDAO
This method selects all histories of a given user and a given type.- Specified by:
findByUserIdAndEvent
in interfaceUserHistoryDAO
- Parameters:
userId
- identifier of the suerevent
- The event specification to restrict the search (optional)- Returns:
- list of histories ordered by date asc
-
createUserHistory
public UserHistory createUserHistory(User user, String eventType, String comment, String sessionId, Client client) Description copied from interface:UserHistoryDAO
Creates an user history entry- Specified by:
createUserHistory
in interfaceUserHistoryDAO
- Parameters:
user
- The user that made the operationeventType
- The event specificationcomment
- The comment provided by the usersessionId
- The user session idclient
- The client connected to LogicalDOC- Returns:
- the created history
-
cleanOldHistories
public void cleanOldHistories(int ttl) Description copied from interface:UserHistoryDAO
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.- Specified by:
cleanOldHistories
in interfaceUserHistoryDAO
- Parameters:
ttl
- The maximum number of days over which the history is considered old
-