Interface ArchiveDAO

All Superinterfaces:
com.logicaldoc.core.PersistentObjectDAO<Archive>
All Known Implementing Classes:
HibernateArchiveDAO

public interface ArchiveDAO extends com.logicaldoc.core.PersistentObjectDAO<Archive>
DAO for Archives handling.
Since:
4.5
Author:
Matteo Caruso - LogicalDOC
  • Field Summary

    Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO

    ENTITY
  • Method Summary

    Modifier and Type
    Method
    Description
    findArchivedIds(long archiveId)
    Retrieves the identifiers of all versions archived into an archive
    findByMode(int mode, Long tenantId)
    Retrieves all the archive with the given mode
    findByModeAndName(int mode, String name, Long tenantId)
    Retrieves all the archive with the given mode and the given name
    findByModeAndStatus(int mode, int status, Long tenantId)
    Retrieves all the archive with the given mode and the given status
    findByModeAndStatusAndType(int mode, int status, int type, Long tenantId)
    Retrieves all the archive with the given mode and the given type
    findByModeAndType(int mode, int type, Long tenantId)
    Retrieves all the archive with the given mode and the given type
    findByName(String name, long tenantId)
    Retrieves the archive by the given name
    findByStatus(int status, Long tenantId)
    Retrieves all the archive with the given status
    void
    Initializes lazy loaded collections
    boolean
    removeVersions(long archiveId, Set<Long> versionIds)
    Performs a bulk update removing all versions from the given archive.
    void
    store(Archive entity, boolean updateSize)
    This method persists the entity object and updates the whole size

    Methods inherited from interface com.logicaldoc.core.PersistentObjectDAO

    bulkUpdate, delete, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForRowSet, queryForString, store
  • Method Details

    • initialize

      void initialize(Archive archive)
      Initializes lazy loaded collections
      Specified by:
      initialize in interface com.logicaldoc.core.PersistentObjectDAO<Archive>
      Parameters:
      archive - The archive to be initialized
    • findByName

      Archive findByName(String name, long tenantId) throws com.logicaldoc.core.PersistenceException
      Retrieves the archive by the given name
      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
    • findByStatus

      List<Archive> findByStatus(int status, Long tenantId) throws com.logicaldoc.core.PersistenceException
      Retrieves all the archive with the given status
      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

      void store(Archive entity, boolean updateSize) throws com.logicaldoc.core.PersistenceException
      This method persists the entity object and updates the whole size
      Parameters:
      entity - entity to be stored.
      updateSize - true if you want to update archive total size
      Throws:
      com.logicaldoc.core.PersistenceException - error in the data layer
    • findArchivedIds

      List<Long> findArchivedIds(long archiveId) throws com.logicaldoc.core.PersistenceException
      Retrieves the identifiers of all versions archived into an archive
      Parameters:
      archiveId - the archive ID
      Returns:
      list of identifiers
      Throws:
      com.logicaldoc.core.PersistenceException - error in the data layer
    • findByMode

      List<Archive> findByMode(int mode, Long tenantId) throws com.logicaldoc.core.PersistenceException
      Retrieves all the archive with the given mode
      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
    • findByModeAndStatus

      List<Archive> findByModeAndStatus(int mode, int status, Long tenantId) throws com.logicaldoc.core.PersistenceException
      Retrieves all the archive with the given mode and the given status
      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
    • findByModeAndName

      List<Archive> findByModeAndName(int mode, String name, Long tenantId) throws com.logicaldoc.core.PersistenceException
      Retrieves all the archive with the given mode and the given name
      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
    • removeVersions

      boolean removeVersions(long archiveId, Set<Long> versionIds) throws com.logicaldoc.core.PersistenceException
      Performs a bulk update removing all versions from the given archive. The export status of the involved documents is set to UNLOCKED.
      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
    • findByModeAndType

      List<Archive> findByModeAndType(int mode, int type, Long tenantId) throws com.logicaldoc.core.PersistenceException
      Retrieves all the archive with the given mode and the given type
      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
    • findByModeAndStatusAndType

      List<Archive> findByModeAndStatusAndType(int mode, int status, int type, Long tenantId) throws com.logicaldoc.core.PersistenceException
      Retrieves all the archive with the given mode and the given type
      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