Class HibernateFolderHistoryDAO

java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<FolderHistory>
com.logicaldoc.core.folder.HibernateFolderHistoryDAO
All Implemented Interfaces:
FolderHistoryDAO, PersistentObjectDAO<FolderHistory>

public class HibernateFolderHistoryDAO extends HibernatePersistentObjectDAO<FolderHistory> implements FolderHistoryDAO
Hibernate implementation of FolderHistoryDAO
Since:
6.4
Author:
Marco Meschieri - LogicalDOC
  • Method Details

    • findByUserId

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

      public List<FolderHistory> findByFolderId(long folderId)
      Description copied from interface: FolderHistoryDAO
      This method selects all histories of a given folder.
      Specified by:
      findByFolderId in interface FolderHistoryDAO
      Parameters:
      folderId - ID of the folder
      Returns:
      list of histories ordered by date
    • findNotNotified

      public List<FolderHistory> findNotNotified(Integer max)
      Description copied from interface: FolderHistoryDAO
      This method selects all histories not notified yet.
      Specified by:
      findNotNotified in interface FolderHistoryDAO
      Parameters:
      max - Optional maximum number of records
      Returns:
      list of histories ordered by date
    • cleanOldHistories

      public void cleanOldHistories(int ttl)
      Description copied from interface: FolderHistoryDAO
      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 FolderHistoryDAO
      Parameters:
      ttl - The maximum number of days over which the history is considered old
    • findByUserIdAndEvent

      public List<FolderHistory> findByUserIdAndEvent(long userId, String event)
      Description copied from interface: FolderHistoryDAO
      This method selects all histories of a given user and related to the given event.
      Specified by:
      findByUserIdAndEvent in interface FolderHistoryDAO
      Parameters:
      userId - The user identifier
      event - The history event
      Returns:
      list of histories ordered by date
    • store

      public void store(FolderHistory history) throws PersistenceException
      Description copied from interface: PersistentObjectDAO
      This method persists the entity object
      Specified by:
      store in interface PersistentObjectDAO<FolderHistory>
      Overrides:
      store in class HibernatePersistentObjectDAO<FolderHistory>
      Parameters:
      history - entity to be stored
      Throws:
      PersistenceException - raised in case of errors in the database
    • findByPath

      public List<FolderHistory> findByPath(String pathExpression, Date oldestDate, Collection<String> events, Integer max)
      Description copied from interface: FolderHistoryDAO
      This method finds all histories about a path (you can use expression)
      Specified by:
      findByPath in interface FolderHistoryDAO
      Parameters:
      pathExpression - The path expression (like /Default/acme%)
      oldestDate - The older date for the retrieved histories
      events - Optional list of event codes to be used as filter
      max - Optional maximum number of records
      Returns:
      The list of histories that matched the given criteria
    • findByFolderIdAndEvent

      public List<FolderHistory> findByFolderIdAndEvent(long folderId, String event, Date oldestDate)
      Description copied from interface: FolderHistoryDAO
      This method selects all histories of a given folder and event occurred after a given date.
      Specified by:
      findByFolderIdAndEvent in interface FolderHistoryDAO
      Parameters:
      folderId - ID of the folder
      event - code of the event to search
      oldestDate - optional oldest date
      Returns:
      list of histories ordered by date