Package com.logicaldoc.core.document.dao
Class HibernateDocumentNoteDAO
- java.lang.Object
-
- com.logicaldoc.core.HibernatePersistentObjectDAO<DocumentNote>
-
- com.logicaldoc.core.document.dao.HibernateDocumentNoteDAO
-
- All Implemented Interfaces:
DocumentNoteDAO
,PersistentObjectDAO<DocumentNote>
public class HibernateDocumentNoteDAO extends HibernatePersistentObjectDAO<DocumentNote> implements DocumentNoteDAO
Hibernate implementation ofDocumentNoteDAO
- Since:
- 6.2
- Author:
- Matteo Caruso - LogicalDOC
-
-
Constructor Summary
Constructors Constructor Description HibernateDocumentNoteDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
copyAnnotations(long docId, String oldFileVersion, String newFileVersion)
Copies all the notes not associated to a specific page from a given file version to anotherboolean
delete(long id, int code)
This method deletes an entity and you can give a deletion codeList<DocumentNote>
findByDocId(long docId, String fileVersion)
This method finds the list of document note regarding a document with the given IDList<DocumentNote>
findByUserId(long userId)
This method finds the list of document notes regarding posted by a specific userboolean
store(DocumentNote note, DocumentHistory transaction)
-
Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO
bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, getSessionFactory, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, 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, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForObject, queryForRowSet, queryForString, store
-
-
-
-
Method Detail
-
store
public boolean store(DocumentNote note, DocumentHistory transaction) throws PersistenceException
- Specified by:
store
in interfaceDocumentNoteDAO
- Throws:
PersistenceException
-
findByDocId
public List<DocumentNote> findByDocId(long docId, String fileVersion)
Description copied from interface:DocumentNoteDAO
This method finds the list of document note regarding a document with the given ID- Specified by:
findByDocId
in interfaceDocumentNoteDAO
- Parameters:
docId
- ID of the document.fileVersion
- indicates a specific file version, 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 interfaceDocumentNoteDAO
- Parameters:
userId
- ID of the user- Returns:
- The list of document notes ordered by descending date
-
delete
public boolean delete(long id, int code) throws PersistenceException
Description copied from interface:PersistentObjectDAO
This method deletes an entity and you can give a deletion code- Specified by:
delete
in interfacePersistentObjectDAO<DocumentNote>
- Overrides:
delete
in classHibernatePersistentObjectDAO<DocumentNote>
- Parameters:
id
- ID of the entity which should be deletedcode
- Deletion code- Returns:
- if the record has been successfully deleted
- Throws:
PersistenceException
- raised in case of errors in the database
-
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 interfaceDocumentNoteDAO
- Parameters:
docId
- The document IDoldFileVersion
- the old versionnewFileVersion
- the version to copy to- Returns:
- Number of copied notes
- Throws:
PersistenceException
- If an error occurs in the database
-
-