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>
@Repository("versionDAO")
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(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.voidinitialize(Version version) Doesn't do anything by defaultvoidThis method persists the given version.voidupdateDigest(Version version) Updates the version's digest (SHA-1)Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO
bulkUpdate, 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.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.logicaldoc.core.PersistentObjectDAO
bulkUpdate, 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
-
Constructor Details
-
HibernateVersionDAO
public HibernateVersionDAO()
-
-
Method Details
-
findByDocId
Description copied from interface:VersionDAOFinds all versions of the given document- Specified by:
findByDocIdin 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:VersionDAOThis method finds a version by the document's ID an the version code.- Specified by:
findByVersionin 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:VersionDAOThis method finds a the first version with the given fileVersion- Specified by:
findByFileVersionin 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:HibernatePersistentObjectDAODoesn't do anything by default- Specified by:
initializein interfacePersistentObjectDAO<Version>- Overrides:
initializein 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:
storein interfacePersistentObjectDAO<Version>- Overrides:
storein classHibernatePersistentObjectDAO<Version>- Parameters:
version- version to be stored.- Throws:
PersistenceException- error at data layer
-
updateDigest
Description copied from interface:VersionDAOUpdates the version's digest (SHA-1)- Specified by:
updateDigestin interfaceVersionDAO- Parameters:
version- The version to be processed- Throws:
PersistenceException- Error in the database
-
delete
Description copied from interface:PersistentObjectDAOThis method deletes an entity and you can give a deletion code- Specified by:
deletein interfacePersistentObjectDAO<Version>- Overrides:
deletein classHibernatePersistentObjectDAO<Version>- Parameters:
versionId- ID of the entity which should be deleteddelCode- Deletion code- Throws:
PersistenceException- raised in case of errors in the database
-