Class HibernateDocumentNoteDAO

    • Constructor Detail

      • HibernateDocumentNoteDAO

        public HibernateDocumentNoteDAO()
    • Method Detail

      • findByDocId

        public List<DocumentNote> findByDocId​(long docId,
                                              String fileVersion)
        Description copied from interface: DocumentNoteDAO
        This method finds the list of document notes regarding a document with the given ID
        Specified by:
        findByDocId in interface DocumentNoteDAO
        Parameters:
        docId - ID of the document.
        fileVersion - indicates a specific file version, optional
        Returns:
        The list of document note
      • findByDocIdAndType

        public List<DocumentNote> findByDocIdAndType​(long docId,
                                                     String fileVersion,
                                                     String type)
        Description copied from interface: DocumentNoteDAO
        This method finds the list of document notes regarding a document with the given ID and optionally filter on the type
        Specified by:
        findByDocIdAndType in interface DocumentNoteDAO
        Parameters:
        docId - ID of the document
        fileVersion - indicates a specific file version, optional
        type - note type, optional
        Returns:
        The list of document note
      • findByDocIdAndTypes

        public List<DocumentNote> findByDocIdAndTypes​(long docId,
                                                      String fileVersion,
                                                      Collection<String> types)
        Description copied from interface: DocumentNoteDAO
        This method finds the list of document notes regarding a document with the given ID and optionally filter on a collection of types
        Specified by:
        findByDocIdAndTypes in interface DocumentNoteDAO
        Parameters:
        docId - ID of the document
        fileVersion - indicates a specific file version, optional
        types - collection of admitted note types, optional
        Returns:
        The list of document note
      • findByUserId

        public List<DocumentNote> findByUserId​(long userId)
        Description copied from interface: DocumentNoteDAO
        This method finds the list of document notes regarding posted by a specific user
        Specified by:
        findByUserId in interface DocumentNoteDAO
        Parameters:
        userId - ID of the user
        Returns:
        The list of document notes ordered by descending date
      • copyAnnotations

        public int copyAnnotations​(long docId,
                                   String oldFileVersion,
                                   String newFileVersion)
                            throws PersistenceException
        Description copied from interface: DocumentNoteDAO
        Copies all the notes not associated to a specific page from a given file version to another
        Specified by:
        copyAnnotations in interface DocumentNoteDAO
        Parameters:
        docId - The document ID
        oldFileVersion - the old version
        newFileVersion - the version to copy to
        Returns:
        Number of copied notes
        Throws:
        PersistenceException - If an error occurs in the database