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 TypeMethodDescriptionvoidcleanOldHistories(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
storeMethods 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, setSessionFactoryMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:UserHistoryDAOThis method selects all histories of a given user.- Specified by:
findByUserIdin interfaceUserHistoryDAO- Parameters:
userId- identifier of the suer- Returns:
- list of histories ordered by date asc
-
findByUserIdAndEvent
Description copied from interface:UserHistoryDAOThis method selects all histories of a given user and a given type.- Specified by:
findByUserIdAndEventin 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, UserEvent eventType, String comment, String sessionId, Client client) Description copied from interface:UserHistoryDAOCreates an user history entry- Specified by:
createUserHistoryin 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:UserHistoryDAOThis method deletes all the user history entries oldest than the given days from now. Ifttlis 0 or -1, the cancellation is not made.- Specified by:
cleanOldHistoriesin interfaceUserHistoryDAO- Parameters:
ttl- The maximum number of days over which the history is considered old
-