Class HibernateUserHistoryDAO

All Implemented Interfaces:
PersistentObjectDAO<UserHistory>, UserHistoryDAO

public class HibernateUserHistoryDAO extends HibernateHistoryDAO<UserHistory> implements UserHistoryDAO
  • Method Details

    • findByUserId

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

      public List<UserHistory> findByUserIdAndEvent(long userId, String event)
      Description copied from interface: UserHistoryDAO
      This method selects all histories of a given user and a given type.
      Specified by:
      findByUserIdAndEvent in interface UserHistoryDAO
      Parameters:
      userId - identifier of the suer
      event - 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 interface UserHistoryDAO
      Parameters:
      user - The user that made the operation
      eventType - The event specification
      comment - The comment provided by the user
      sessionId - The user session id
      client - 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. If ttl is 0 or -1, the cancellation is not made.
      Specified by:
      cleanOldHistories in interface UserHistoryDAO
      Parameters:
      ttl - The maximum number of days over which the history is considered old