Package com.logicaldoc.core.document.dao
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 ofBookmarkDAO
- Since:
- 5.2
- Author:
- Matteo Caruso - LogicalDOC
-
-
Field Summary
-
Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO
ENTITY
-
-
Constructor Summary
Constructors Constructor Description HibernateBookmarkDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Long>
findBookmarkedDocs(long userId)
Finds the identifiers of the docs bookmarked by the given userList<Bookmark>
findByUserId(long userId)
Finds all bookmarks for the given user idBookmark
findByUserIdAndDocId(long userId, long docId)
Finds all bookmarks for the given user id and the given document's identifierBookmark
findByUserIdAndFolderId(long userId, long folderId)
Finds the bookmark for the given user id and the given folder idboolean
isDocBookmarkedByUser(long docId, long userId)
Checks if the document is bookmarked by a user-
Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO
bulkUpdate, bulkUpdate, delete, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, getSessionFactory, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForString, setSessionFactory, store
-
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, bulkUpdate, delete, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForString, store
-
-
-
-
Method Detail
-
findByUserId
public List<Bookmark> findByUserId(long userId)
Description copied from interface:BookmarkDAO
Finds all bookmarks for the given user id- Specified by:
findByUserId
in interfaceBookmarkDAO
- 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 interfaceBookmarkDAO
- Parameters:
userId
- ID of the userdocId
- 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 interfaceBookmarkDAO
- Parameters:
userId
- ID of the userfolderId
- 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 interfaceBookmarkDAO
- 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 interfaceBookmarkDAO
- Parameters:
docId
- identifier of the documentuserId
- identifier of the user- Returns:
- true id the document was bookmarked
-
-