Package com.logicaldoc.core.document
Class HibernateDocumentNoteDAO
java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<DocumentNote>
com.logicaldoc.core.document.HibernateDocumentNoteDAO
- All Implemented Interfaces:
- DocumentNoteDAO,- PersistentObjectDAO<DocumentNote>
@Repository("documentNoteDAO")
public class HibernateDocumentNoteDAO
extends HibernatePersistentObjectDAO<DocumentNote>
implements DocumentNoteDAO
Hibernate implementation of 
DocumentNoteDAO- Since:
- 6.2
- Author:
- Matteo Caruso - LogicalDOC
- 
Field SummaryFields inherited from interface com.logicaldoc.core.PersistentObjectDAOENTITY
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintcopyAnnotations(long docId, String oldFileVersion, String newFileVersion) Copies all the notes not associated to a specific page from a given file version to anothervoiddelete(long id, int code) This method deletes an entity and you can give a deletion codefindByDocId(long docId, String fileVersion) This method finds the list of document notes regarding a document with the given IDfindByDocIdAndType(long docId, String fileVersion, String type) This method finds the list of document notes regarding a document with the given ID and optionally filter on the typefindByDocIdAndTypes(long docId, String fileVersion, Collection<String> types) This method finds the list of document notes regarding a document with the given ID and optionally filter on a collection of typesfindByUserId(long userId) This method finds the list of document notes regarding posted by a specific uservoidstore(DocumentNote note) This method persists the entity objectvoidstore(DocumentNote note, DocumentHistory transaction) Stores a note and saves the document's historyMethods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAObulkUpdate, delete, deleteAll, deleteAll, evict, evict, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, initialize, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, queryForString, setSessionFactoryMethods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.logicaldoc.core.PersistentObjectDAObulkUpdate, delete, deleteAll, deleteAll, evict, evict, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, initialize, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, queryForString
- 
Constructor Details- 
HibernateDocumentNoteDAOpublic HibernateDocumentNoteDAO()
 
- 
- 
Method Details- 
storeDescription copied from interface:PersistentObjectDAOThis method persists the entity object- Specified by:
- storein interface- PersistentObjectDAO<DocumentNote>
- Overrides:
- storein class- HibernatePersistentObjectDAO<DocumentNote>
- Parameters:
- note- entity to be stored
- Throws:
- PersistenceException- raised in case of errors in the database
 
- 
storeDescription copied from interface:DocumentNoteDAOStores a note and saves the document's history- Specified by:
- storein interface- DocumentNoteDAO
- Parameters:
- note- the note
- transaction- session informations
- Throws:
- PersistenceException- error at data layer
 
- 
findByDocIdDescription copied from interface:DocumentNoteDAOThis method finds the list of document notes regarding a document with the given ID- Specified by:
- findByDocIdin interface- DocumentNoteDAO
- Parameters:
- docId- ID of the document.
- fileVersion- indicates a specific file version, optional
- Returns:
- The list of document note
- Throws:
- PersistenceException- Error in the database
 
- 
findByDocIdAndTypepublic List<DocumentNote> findByDocIdAndType(long docId, String fileVersion, String type) throws PersistenceException Description copied from interface:DocumentNoteDAOThis method finds the list of document notes regarding a document with the given ID and optionally filter on the type- Specified by:
- findByDocIdAndTypein 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
- Throws:
- PersistenceException- Error in the database
 
- 
findByDocIdAndTypespublic List<DocumentNote> findByDocIdAndTypes(long docId, String fileVersion, Collection<String> types) throws PersistenceException Description copied from interface:DocumentNoteDAOThis method finds the list of document notes regarding a document with the given ID and optionally filter on a collection of types- Specified by:
- findByDocIdAndTypesin 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
- Throws:
- PersistenceException- Error in the database
 
- 
findByUserIdDescription copied from interface:DocumentNoteDAOThis method finds the list of document notes regarding posted by a specific user- Specified by:
- findByUserIdin interface- DocumentNoteDAO
- Parameters:
- userId- ID of the user
- Returns:
- The list of document notes ordered by descending date
- Throws:
- PersistenceException- Errorin the database
 
- 
deleteDescription copied from interface:PersistentObjectDAOThis method deletes an entity and you can give a deletion code- Specified by:
- deletein interface- PersistentObjectDAO<DocumentNote>
- Overrides:
- deletein class- HibernatePersistentObjectDAO<DocumentNote>
- Parameters:
- id- ID of the entity which should be deleted
- code- Deletion code
- Throws:
- PersistenceException- raised in case of errors in the database
 
- 
copyAnnotationspublic int copyAnnotations(long docId, String oldFileVersion, String newFileVersion) throws PersistenceException Description copied from interface:DocumentNoteDAOCopies all the notes not associated to a specific page from a given file version to another- Specified by:
- copyAnnotationsin 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
 
 
-