Package com.logicaldoc.core.document

# Interface VersionDAO

All Superinterfaces:
  `PersistentObjectDAO<Version>`

All Known Implementing Classes:
  `HibernateVersionDAO`

public interface VersionDAO extends PersistentObjectDAO<Version>
This class is a DAO-service for versions.

Version:
  4.5
Author:
  Marco Meschieri - LogicalDOC

## Field Summary

### Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO

`ENTITY`

## Method Summary

Modifier and Type
Method
Description
`List<Version>`
`findByDocId(long docId)`
Finds all versions of the given document
`Version`
`findByFileVersion(long docId, String fileVersion)`
This method finds a the first version with the given fileVersion
`Version`
`findByVersion(long docId, String version)`
This method finds a version by the document's ID an the version code.
`static VersionDAO`
`get()`
Gets the object available in the application context
`void`
`updateDigest(Version version)`
Updates the version's digest (SHA-1)

### Methods inherited from interface com.logicaldoc.core.PersistentObjectDAO

`bulkUpdate, count, count, count, delete, delete, deleteAll, deleteAll, evict, evict, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, initialize, initialize, isMariaDB, isMySQL, isOracle, isPostgreSQL, isSQLServer, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, queryForString, store`

## Method Details

### get

static VersionDAO get()
Gets the object available in the application context

Returns:
  the instance of this object in the application context

### findByVersion

Version findByVersion(long docId, String version) throws PersistenceException
This method finds a version by the document's ID an the version code.

Parameters:
  `docId` - ID of the document
  `version` - the version code
Returns:
  the found version
Throws:
  `PersistenceException` - Error in the database

### findByFileVersion

Version findByFileVersion(long docId, String fileVersion) throws PersistenceException
This method finds a the first version with the given fileVersion

Parameters:
  `docId` - ID of the document
  `fileVersion` - the fileVersion code
Returns:
  the found version
Throws:
  `PersistenceException` - Error in the database

### findByDocId

List<Version> findByDocId(long docId) throws PersistenceException
Finds all versions of the given document

Parameters:
  `docId` - The document's id
Returns:
  The list of versions ordered by descending date
Throws:
  `PersistenceException` - Error in the database

### updateDigest

void updateDigest(Version version) throws PersistenceException
Updates the version's digest (SHA-1)

Parameters:
  `version` - The version to be processed
Throws:
  `PersistenceException` - Error in the database