Package com.logicaldoc.impex.dao
Class HibernateArchiveDAO
- java.lang.Object
-
- com.logicaldoc.core.HibernatePersistentObjectDAO<Archive>
-
- com.logicaldoc.impex.dao.HibernateArchiveDAO
-
- All Implemented Interfaces:
com.logicaldoc.core.PersistentObjectDAO<Archive>,ArchiveDAO
public class HibernateArchiveDAO extends com.logicaldoc.core.HibernatePersistentObjectDAO<Archive> implements ArchiveDAO
Hibernate implementation of the ArchiveDAO.- Since:
- 4.5
- Author:
- Matteo Caruso - LogicalDOC
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandelete(long archiveId, int code)List<Long>findArchivedIds(long archiveId)Retrieves the identifiers of all versions archived into an archiveList<Archive>findByMode(int mode, Long tenantId)Retrieves all the archive with the given modeList<Archive>findByModeAndName(int mode, String name, Long tenantId)Retrieves all the archive with the given mode and the given nameList<Archive>findByModeAndStatus(int mode, int status, Long tenantId)Retrieves all the archive with the given mode and the given statusList<Archive>findByModeAndStatusAndType(int mode, int status, int type, Long tenantId)Retrieves all the archive with the given mode and the given typeList<Archive>findByModeAndType(int mode, int type, Long tenantId)Retrieves all the archive with the given mode and the given typeArchivefindByName(String name, long tenantId)Retrieves the archive by the given nameList<Archive>findByStatus(int status, Long tenantId)Retrieves all the archive with the given statusArchiveCacheManagergetCacheManager()voidinitialize(Archive archive)Initializes lazy loaded collectionsbooleanremoveVersions(long archiveId, Long[] versionIds)Performs a bulk update removing all versions from the given archive.voidsetCacheManager(ArchiveCacheManager cacheManager)booleanstore(Archive archive)booleanstore(Archive archive, boolean updateSize)This method persists the entity object and updates the whole size-
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, 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, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForObject, queryForRowSet, queryForString
-
-
-
-
Method Detail
-
getCacheManager
public ArchiveCacheManager getCacheManager()
-
setCacheManager
public void setCacheManager(ArchiveCacheManager cacheManager)
-
initialize
public void initialize(Archive archive)
Description copied from interface:ArchiveDAOInitializes lazy loaded collections- Specified by:
initializein interfaceArchiveDAO- Specified by:
initializein interfacecom.logicaldoc.core.PersistentObjectDAO<Archive>- Overrides:
initializein classcom.logicaldoc.core.HibernatePersistentObjectDAO<Archive>- Parameters:
archive- The archive to be initialized
-
findByName
public Archive findByName(String name, long tenantId)
Description copied from interface:ArchiveDAORetrieves the archive by the given name- Specified by:
findByNamein interfaceArchiveDAO- Parameters:
name- The archive nametenantId- The tenant of the archive- Returns:
- The archive with the given name
-
delete
public boolean delete(long archiveId, int code)
-
findByStatus
public List<Archive> findByStatus(int status, Long tenantId)
Description copied from interface:ArchiveDAORetrieves all the archive with the given status- Specified by:
findByStatusin interfaceArchiveDAO- Parameters:
status- The archive statustenantId- The archive tenant- Returns:
- A list of archives with the given status
-
store
public boolean store(Archive archive) throws com.logicaldoc.core.PersistenceException
-
store
public boolean 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 interfaceArchiveDAO- Parameters:
archive- entity to be stored.updateSize- true if you want to update archive total size- Returns:
- True if successfully stored in a database.
- Throws:
com.logicaldoc.core.PersistenceException- error in the database
-
findArchivedIds
public List<Long> findArchivedIds(long archiveId)
Description copied from interface:ArchiveDAORetrieves the identifiers of all versions archived into an archive- Specified by:
findArchivedIdsin interfaceArchiveDAO- Parameters:
archiveId- the archive ID- Returns:
- list of identifiers
-
findByMode
public List<Archive> findByMode(int mode, Long tenantId)
Description copied from interface:ArchiveDAORetrieves all the archive with the given mode- Specified by:
findByModein interfaceArchiveDAO- Parameters:
mode- The archive modetenantId- The archive tenant- Returns:
- A list of archives with the given mode
-
findByModeAndStatus
public List<Archive> findByModeAndStatus(int mode, int status, Long tenantId)
Description copied from interface:ArchiveDAORetrieves all the archive with the given mode and the given status- Specified by:
findByModeAndStatusin interfaceArchiveDAO- Parameters:
mode- The archive modestatus- The archive statustenantId- The archive tenant- Returns:
- A list of archives with the given mode and the given status ordered by creation date descending
-
findByModeAndType
public List<Archive> findByModeAndType(int mode, int type, Long tenantId)
Description copied from interface:ArchiveDAORetrieves all the archive with the given mode and the given type- Specified by:
findByModeAndTypein interfaceArchiveDAO- Parameters:
mode- The archive modetype- The archive typetenantId- The archive tenant- Returns:
- A list of archives with the given mode and the given type ordered by creation date descending
-
findByModeAndName
public List<Archive> findByModeAndName(int mode, String name, Long tenantId)
Description copied from interface:ArchiveDAORetrieves all the archive with the given mode and the given name- Specified by:
findByModeAndNamein interfaceArchiveDAO- Parameters:
mode- The archive modename- The archive nametenantId- The archive tenant- Returns:
- A list of archives with the given mode and the given name
-
removeVersions
public boolean removeVersions(long archiveId, Long[] versionIds)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 interfaceArchiveDAO- Parameters:
archiveId- The archive identifierversionIds- The array of version ids to be removed- Returns:
- if the versions were correctly removed
-
findByModeAndStatusAndType
public List<Archive> findByModeAndStatusAndType(int mode, int status, int type, Long tenantId)
Description copied from interface:ArchiveDAORetrieves all the archive with the given mode and the given type- Specified by:
findByModeAndStatusAndTypein interfaceArchiveDAO- Parameters:
mode- The archive modestatus- The archive statustype- The archive typetenantId- The archive tenant- Returns:
- A list of archives with the given mode, the given status and the given type ordered by creation date descending
-
-