Package com.logicaldoc.core.document
Class HibernateVersionDAO
java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<Version>
com.logicaldoc.core.document.HibernateVersionDAO
- All Implemented Interfaces:
VersionDAO
,PersistentObjectDAO<Version>
public class HibernateVersionDAO
extends HibernatePersistentObjectDAO<Version>
implements VersionDAO
Hibernate implementation of
VersionDAO
- Since:
- 3.0
- Author:
- Marco Meschieri - LogicalDOC
-
Field Summary
Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO
ENTITY
-
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(long versionId, int delCode) This method deletes an entity and you can give a deletion codefindByDocId
(long docId) Finds all versions of the given documentfindByFileVersion
(long docId, String fileVersion) This method finds a the first version with the given fileVersionfindByVersion
(long docId, String version) This method finds a version by the document's ID an the version code.void
initialize
(Version version) Doesn't do anything by defaultvoid
setFolderDAO
(FolderDAO folderDAO) void
void
This method persists the given version.void
updateDigest
(Version version) Updates the version's digest (SHA-1)Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO
bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, getSessionFactory, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, 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, getDatabaseMetadata, getDbms, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForRowSet, queryForString
-
Method Details
-
findByDocId
Description copied from interface:VersionDAO
Finds all versions of the given document- Specified by:
findByDocId
in interfaceVersionDAO
- Parameters:
docId
- The document's id- Returns:
- The list of versions ordered by descending date
- Throws:
PersistenceException
- Error in the database
-
findByVersion
Description copied from interface:VersionDAO
This method finds a version by the document's ID an the version code.- Specified by:
findByVersion
in interfaceVersionDAO
- Parameters:
docId
- ID of the documentversion
- the version code- Returns:
- the found version
- Throws:
PersistenceException
- Error in the database
-
findByFileVersion
Description copied from interface:VersionDAO
This method finds a the first version with the given fileVersion- Specified by:
findByFileVersion
in interfaceVersionDAO
- Parameters:
docId
- ID of the documentfileVersion
- the fileVersion code- Returns:
- the found version
- Throws:
PersistenceException
- Error in the database
-
initialize
Description copied from class:HibernatePersistentObjectDAO
Doesn't do anything by default- Specified by:
initialize
in interfacePersistentObjectDAO<Version>
- Overrides:
initialize
in classHibernatePersistentObjectDAO<Version>
- Parameters:
version
- The entity to be initialised
-
store
This method persists the given version. Checks if is necessary to delete some document versions reading the context property 'document.maxversions' and the maxVersions property of the owning workspace.- Specified by:
store
in interfacePersistentObjectDAO<Version>
- Overrides:
store
in classHibernatePersistentObjectDAO<Version>
- Parameters:
version
- version to be stored.- Throws:
PersistenceException
- error at data layer
-
updateDigest
Description copied from interface:VersionDAO
Updates the version's digest (SHA-1)- Specified by:
updateDigest
in interfaceVersionDAO
- Parameters:
version
- The version to be processed
-
setStorer
-
delete
Description copied from interface:PersistentObjectDAO
This method deletes an entity and you can give a deletion code- Specified by:
delete
in interfacePersistentObjectDAO<Version>
- Overrides:
delete
in classHibernatePersistentObjectDAO<Version>
- Parameters:
versionId
- ID of the entity which should be deleteddelCode
- Deletion code- Throws:
PersistenceException
- raised in case of errors in the database
-
setFolderDAO
-