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 boolean
delete(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 documentVersion
findByFileVersion(long docId, String fileVersion)
This method finds a the first version with the given fileVersionVersion
findByVersion(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
setStorer(Storer storer)
boolean
store(Version version)
This method persists the entity objectvoid
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, 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: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
-
findByVersion
public Version findByVersion(long docId, String version)
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
-
findByFileVersion
public Version findByFileVersion(long docId, String fileVersion)
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
-
initialize
public void initialize(Version version)
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
public boolean store(Version version)
Description copied from interface:PersistentObjectDAO
This method persists the entity object- Specified by:
store
in interfacePersistentObjectDAO<Version>
- Specified by:
store
in interfaceVersionDAO
- Overrides:
store
in 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:VersionDAO
Updates the version's digest (SHA-1)- Specified by:
updateDigest
in 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: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- Returns:
- if the record has been successfully deleted
-
setFolderDAO
public void setFolderDAO(FolderDAO folderDAO)
-
-