Package com.logicaldoc.core.document.dao
Class HibernateVersionDAO
- java.lang.Object
-
- com.logicaldoc.core.HibernatePersistentObjectDAO<Version>
-
- com.logicaldoc.core.document.dao.HibernateVersionDAO
-
- All Implemented Interfaces:
VersionDAO,PersistentObjectDAO<Version>
public class HibernateVersionDAO extends HibernatePersistentObjectDAO<Version> implements VersionDAO
Hibernate implementation ofDocumentDAO- Since:
- 3.0
- Author:
- Marco Meschieri - LogicalDOC
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandelete(long versionId, int delCode)This method deletes an entity and you can give a deletion codeList<Version>findByDocId(long docId)Finds all versions of the given documentVersionfindByFileVersion(long docId, String fileVersion)This method finds a the first version with the given fileVersionVersionfindByVersion(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 defaultvoidsetFolderDAO(FolderDAO folderDAO)voidsetStorer(Storer storer)booleanstore(Version version)This method persists the entity objectvoidupdateDigest(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, 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
-
findByDocId
public List<Version> findByDocId(long docId)
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
-
findByVersion
public Version findByVersion(long docId, String version)
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
-
findByFileVersion
public Version findByFileVersion(long docId, String fileVersion)
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
-
initialize
public void initialize(Version version)
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
public boolean store(Version version)
Description copied from interface:PersistentObjectDAOThis method persists the entity object- Specified by:
storein interfacePersistentObjectDAO<Version>- Specified by:
storein interfaceVersionDAO- Overrides:
storein classHibernatePersistentObjectDAO<Version>- Parameters:
version- entity to be stored- Returns:
- True if successfully stored in a database
-
updateDigest
public void updateDigest(Version version)
Description copied from interface:VersionDAOUpdates the version's digest (SHA-1)- Specified by:
updateDigestin interfaceVersionDAO- Parameters:
version- The version to be processed
-
setStorer
public void setStorer(Storer storer)
-
delete
public boolean delete(long versionId, int delCode)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- Returns:
- if the record has been successfully deleted
-
setFolderDAO
public void setFolderDAO(FolderDAO folderDAO)
-
-