Package com.logicaldoc.impex
Class HibernateArchiveDAO
java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<Archive>
com.logicaldoc.impex.HibernateArchiveDAO
- All Implemented Interfaces:
- com.logicaldoc.core.PersistentObjectDAO<Archive>,- ArchiveDAO
@Repository("archiveDAO")
public class HibernateArchiveDAO
extends com.logicaldoc.core.HibernatePersistentObjectDAO<Archive>
implements ArchiveDAO
Hibernate implementation of the ArchiveDAO.
- Since:
- 4.5
- Author:
- Matteo Caruso - LogicalDOC
- 
Field SummaryFields inherited from interface com.logicaldoc.core.PersistentObjectDAOENTITY
- 
Method SummaryModifier and TypeMethodDescriptionvoiddelete(long archiveId, int code) findArchivedIds(long archiveId) Retrieves the identifiers of all versions archived into an archivefindByMode(int mode, Long tenantId) Retrieves all the archive with the given modefindByModeAndName(int mode, String name, Long tenantId) Retrieves all the archive with the given mode and the given namefindByModeAndStatus(int mode, int status, Long tenantId) Retrieves all the archive with the given mode and the given statusfindByModeAndStatusAndType(int mode, int status, int type, Long tenantId) Retrieves all the archive with the given mode and the given typefindByModeAndType(int mode, int type, Long tenantId) Retrieves all the archive with the given mode and the given typefindByName(String name, long tenantId) Retrieves the archive by the given namefindByStatus(int status, Long tenantId) Retrieves all the archive with the given statusvoidinitialize(Archive archive) Initializes lazy loaded collectionsbooleanremoveVersions(long archiveId, Set<Long> versionIds) Performs a bulk update removing all versions from the given archive.voidsetCacheManager(ArchiveCacheManager cacheManager) voidvoidThis method persists the entity object and updates the whole sizeMethods 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, 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, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, queryForString
- 
Method Details- 
getCacheManager
- 
setCacheManager
- 
initializeDescription copied from interface:ArchiveDAOInitializes lazy loaded collections- Specified by:
- initializein interface- ArchiveDAO
- Specified by:
- initializein interface- com.logicaldoc.core.PersistentObjectDAO<Archive>
- Overrides:
- initializein class- com.logicaldoc.core.HibernatePersistentObjectDAO<Archive>
- Parameters:
- archive- The archive to be initialized
 
- 
findByNamepublic Archive findByName(String name, long tenantId) throws com.logicaldoc.core.PersistenceException Description copied from interface:ArchiveDAORetrieves the archive by the given name- Specified by:
- findByNamein interface- ArchiveDAO
- Parameters:
- name- The archive name
- tenantId- The tenant of the archive
- Returns:
- The archive with the given name
- Throws:
- com.logicaldoc.core.PersistenceException- error in the data layer
 
- 
deletepublic void delete(long archiveId, int code) throws com.logicaldoc.core.PersistenceException 
- 
findByStatuspublic List<Archive> findByStatus(int status, Long tenantId) throws com.logicaldoc.core.PersistenceException Description copied from interface:ArchiveDAORetrieves all the archive with the given status- Specified by:
- findByStatusin interface- ArchiveDAO
- Parameters:
- status- The archive status
- tenantId- The archive tenant
- Returns:
- A list of archives with the given status
- Throws:
- com.logicaldoc.core.PersistenceException- error in the data layer
 
- 
store
- 
storepublic void store(Archive archive, boolean updateSize) throws com.logicaldoc.core.PersistenceException Description copied from interface:ArchiveDAOThis method persists the entity object and updates the whole size- Specified by:
- storein interface- ArchiveDAO
- Parameters:
- archive- entity to be stored.
- updateSize- true if you want to update archive total size
- Throws:
- com.logicaldoc.core.PersistenceException- error in the data layer
 
- 
findArchivedIdsDescription copied from interface:ArchiveDAORetrieves the identifiers of all versions archived into an archive- Specified by:
- findArchivedIdsin interface- ArchiveDAO
- Parameters:
- archiveId- the archive ID
- Returns:
- list of identifiers
- Throws:
- com.logicaldoc.core.PersistenceException- error in the data layer
 
- 
findByModepublic List<Archive> findByMode(int mode, Long tenantId) throws com.logicaldoc.core.PersistenceException Description copied from interface:ArchiveDAORetrieves all the archive with the given mode- Specified by:
- findByModein interface- ArchiveDAO
- Parameters:
- mode- The archive mode
- tenantId- The archive tenant
- Returns:
- A list of archives with the given mode
- Throws:
- com.logicaldoc.core.PersistenceException- error in the data layer
 
- 
findByModeAndStatuspublic List<Archive> findByModeAndStatus(int mode, int status, Long tenantId) throws com.logicaldoc.core.PersistenceException Description copied from interface:ArchiveDAORetrieves all the archive with the given mode and the given status- Specified by:
- findByModeAndStatusin interface- ArchiveDAO
- Parameters:
- mode- The archive mode
- status- The archive status
- tenantId- The archive tenant
- Returns:
- A list of archives with the given mode and the given status ordered by creation date descending
- Throws:
- com.logicaldoc.core.PersistenceException- error in the data layer
 
- 
findByModeAndTypepublic List<Archive> findByModeAndType(int mode, int type, Long tenantId) throws com.logicaldoc.core.PersistenceException Description copied from interface:ArchiveDAORetrieves all the archive with the given mode and the given type- Specified by:
- findByModeAndTypein interface- ArchiveDAO
- Parameters:
- mode- The archive mode
- type- The archive type
- tenantId- The archive tenant
- Returns:
- A list of archives with the given mode and the given type ordered by creation date descending
- Throws:
- com.logicaldoc.core.PersistenceException- error in the data layer
 
- 
findByModeAndNamepublic List<Archive> findByModeAndName(int mode, String name, Long tenantId) throws com.logicaldoc.core.PersistenceException Description copied from interface:ArchiveDAORetrieves all the archive with the given mode and the given name- Specified by:
- findByModeAndNamein interface- ArchiveDAO
- Parameters:
- mode- The archive mode
- name- The archive name
- tenantId- The archive tenant
- Returns:
- A list of archives with the given mode and the given name
- Throws:
- com.logicaldoc.core.PersistenceException- error in the data layer
 
- 
removeVersionspublic boolean removeVersions(long archiveId, Set<Long> versionIds) throws com.logicaldoc.core.PersistenceException Description copied from interface:ArchiveDAOPerforms a bulk update removing all versions from the given archive. The export status of the involved documents is set to UNLOCKED.- Specified by:
- removeVersionsin interface- ArchiveDAO
- Parameters:
- archiveId- The archive identifier
- versionIds- The set of version ids to be removed
- Returns:
- if the versions were correctly removed
- Throws:
- com.logicaldoc.core.PersistenceException- error in the data layer
 
- 
findByModeAndStatusAndTypepublic List<Archive> findByModeAndStatusAndType(int mode, int status, int type, Long tenantId) throws com.logicaldoc.core.PersistenceException Description copied from interface:ArchiveDAORetrieves all the archive with the given mode and the given type- Specified by:
- findByModeAndStatusAndTypein interface- ArchiveDAO
- Parameters:
- mode- The archive mode
- status- The archive status
- type- The archive type
- tenantId- The archive tenant
- Returns:
- A list of archives with the given mode, the given status and the given type ordered by creation date descending
- Throws:
- com.logicaldoc.core.PersistenceException- error in the data layer
 
 
-