Package com.logicaldoc.core.security.dao
Class HibernateUserHistoryDAO
java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<UserHistory>
com.logicaldoc.core.security.dao.HibernateUserHistoryDAO
- All Implemented Interfaces:
PersistentObjectDAO<UserHistory>
,UserHistoryDAO
public class HibernateUserHistoryDAO
extends HibernatePersistentObjectDAO<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.void
store
(UserHistory history) This method persists the entity objectMethods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO
bulkUpdate, delete, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, getSessionFactory, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForRowSet, 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, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForRowSet, queryForString
-
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- See Also:
-
store
Description copied from interface:PersistentObjectDAO
This method persists the entity object- Specified by:
store
in interfacePersistentObjectDAO<UserHistory>
- Overrides:
store
in classHibernatePersistentObjectDAO<UserHistory>
- Parameters:
history
- entity to be stored- Throws:
PersistenceException
- raised in case of errors in the database
-