Class HibernateBookmarkDAO

java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<Bookmark>
com.logicaldoc.core.document.dao.HibernateBookmarkDAO
All Implemented Interfaces:
BookmarkDAO, PersistentObjectDAO<Bookmark>

public class HibernateBookmarkDAO extends HibernatePersistentObjectDAO<Bookmark> implements BookmarkDAO
Hibernate implementation of BookmarkDAO
Since:
5.2
Author:
Matteo Caruso - LogicalDOC
  • Constructor Details

    • HibernateBookmarkDAO

      public HibernateBookmarkDAO()
  • Method Details

    • findByUserId

      public List<Bookmark> findByUserId(long userId)
      Description copied from interface: BookmarkDAO
      Finds all bookmarks for the given user id
      Specified by:
      findByUserId in interface BookmarkDAO
      Parameters:
      userId - ID of the user
      Returns:
      Collection of all bookmarks for the specified user ordered by position
    • findByUserIdAndDocId

      public Bookmark findByUserIdAndDocId(long userId, long docId)
      Description copied from interface: BookmarkDAO
      Finds all bookmarks for the given user id and the given document's identifier
      Specified by:
      findByUserIdAndDocId in interface BookmarkDAO
      Parameters:
      userId - ID of the user
      docId - ID of the document
      Returns:
      The bookmark
    • findByUserIdAndFolderId

      public Bookmark findByUserIdAndFolderId(long userId, long folderId)
      Description copied from interface: BookmarkDAO
      Finds the bookmark for the given user id and the given folder id
      Specified by:
      findByUserIdAndFolderId in interface BookmarkDAO
      Parameters:
      userId - ID of the user
      folderId - ID of the folder
      Returns:
      The bookmark
    • findBookmarkedDocs

      public List<Long> findBookmarkedDocs(long userId)
      Description copied from interface: BookmarkDAO
      Finds the identifiers of the docs bookmarked by the given user
      Specified by:
      findBookmarkedDocs in interface BookmarkDAO
      Parameters:
      userId - identifier of the user
      Returns:
      list of document identifiers
    • isDocBookmarkedByUser

      public boolean isDocBookmarkedByUser(long docId, long userId)
      Description copied from interface: BookmarkDAO
      Checks if the document is bookmarked by a user
      Specified by:
      isDocBookmarkedByUser in interface BookmarkDAO
      Parameters:
      docId - identifier of the document
      userId - identifier of the user
      Returns:
      true id the document was bookmarked