Package com.logicaldoc.core.document.dao
Class HibernateDocumentLinkDAO
- java.lang.Object
-
- com.logicaldoc.core.HibernatePersistentObjectDAO<DocumentLink>
-
- com.logicaldoc.core.document.dao.HibernateDocumentLinkDAO
-
- All Implemented Interfaces:
DocumentLinkDAO,PersistentObjectDAO<DocumentLink>
public class HibernateDocumentLinkDAO extends HibernatePersistentObjectDAO<DocumentLink> implements DocumentLinkDAO
Hibernate implementation ofDocumentLinkDAO- Since:
- 4.0
- Author:
- Matteo Caruso - LogicalDOC
-
-
Constructor Summary
Constructors Constructor Description HibernateDocumentLinkDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandelete(long id, int code)This method deletes an entity and you can give a deletion codeList<DocumentLink>findByDocId(long docId)This method finds the list of document link in which there is a document with the given IDList<DocumentLink>findByDocId(long docId, String type)This method finds the list of document link, filtered by the given link type, in which there is a document with the given IDDocumentLinkfindByDocIdsAndType(long docId1, long docId2, String type)Find a document link using its alternate keysbooleanstore(DocumentLink entity)This method persists the entity object-
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
-
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
-
-
-
-
Method Detail
-
findByDocId
public List<DocumentLink> findByDocId(long docId)
Description copied from interface:DocumentLinkDAOThis method finds the list of document link in which there is a document with the given ID- Specified by:
findByDocIdin interfaceDocumentLinkDAO- Parameters:
docId- ID of the document- Returns:
- The list of document link
- See Also:
DocumentLinkDAO.findByDocId(long)
-
findByDocId
public List<DocumentLink> findByDocId(long docId, String type)
Description copied from interface:DocumentLinkDAOThis method finds the list of document link, filtered by the given link type, in which there is a document with the given ID- Specified by:
findByDocIdin interfaceDocumentLinkDAO- Parameters:
docId- ID of the documenttype- Type of each document link in the return list- Returns:
- The list of document link
- See Also:
DocumentLinkDAO.findByDocId(long, java.lang.String)
-
findByDocIdsAndType
public DocumentLink findByDocIdsAndType(long docId1, long docId2, String type)
Description copied from interface:DocumentLinkDAOFind a document link using its alternate keys- Specified by:
findByDocIdsAndTypein interfaceDocumentLinkDAO- Parameters:
docId1- identifier of the first documentdocId2- identifier of the secondtype- the document type(null or pdf- Returns:
- The found instance
-
delete
public boolean delete(long id, int code)Description copied from interface:PersistentObjectDAOThis method deletes an entity and you can give a deletion code- Specified by:
deletein interfacePersistentObjectDAO<DocumentLink>- Overrides:
deletein classHibernatePersistentObjectDAO<DocumentLink>- Parameters:
id- ID of the entity which should be deletedcode- Deletion code- Returns:
- if the record has been successfully deleted
-
store
public boolean store(DocumentLink entity) throws PersistenceException
Description copied from interface:PersistentObjectDAOThis method persists the entity object- Specified by:
storein interfacePersistentObjectDAO<DocumentLink>- Overrides:
storein classHibernatePersistentObjectDAO<DocumentLink>- Parameters:
entity- entity to be stored- Returns:
- True if successfully stored in a database
- Throws:
PersistenceException- raised in case of errors in the database
-
-