Interface UserHistoryDAO

All Superinterfaces:
PersistentObjectDAO<UserHistory>
All Known Implementing Classes:
HibernateUserHistoryDAO

public interface UserHistoryDAO extends PersistentObjectDAO<UserHistory>
DAO for UserHistory handling.
Since:
5.0
Author:
Matteo Caruso - LogicalDOC
  • Method Details

    • findByUserId

      List<UserHistory> findByUserId(long userId)
      This method selects all histories of a given user.
      Parameters:
      userId - identifier of the suer
      Returns:
      list of histories ordered by date asc
    • findByUserIdAndEvent

      List<UserHistory> findByUserIdAndEvent(long userId, String event)
      This method selects all histories of a given user and a given type.
      Parameters:
      userId - identifier of the suer
      event - 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 operation
      event - The event specification
      comment - The comment provided by the user
      client - The client connected to LogicalDOC
      sessionId - 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. If ttl is 0 or -1, the cancellation is not made.
      Parameters:
      ttl - The maximum number of days over which the history is considered old