Package org.dspace.versioning.dao.impl
Class VersionDAOImpl
- java.lang.Object
-
- org.dspace.core.AbstractHibernateDAO<Version>
-
- org.dspace.versioning.dao.impl.VersionDAOImpl
-
- All Implemented Interfaces:
GenericDAO<Version>,VersionDAO
public class VersionDAOImpl extends AbstractHibernateDAO<Version> implements VersionDAO
Hibernate implementation of the Database Access Object interface class for the Version object. This class is responsible for all database calls for the Version object and is autowired by spring This class should never be accessed directly.- Author:
- Fabio Bolognesi (fabio at atmire dot com), Mark Diggory (markd at atmire dot com), Ben Bosman (ben at atmire dot com), kevinvandevelde at atmire.com, Pascal-Nicolas Becker (dspace at pascal dash becker dot de)
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedVersionDAOImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountVersionsByHistoryWithItem(Context context, VersionHistory versionHistory)This method count versions of an version history that have items assigned.VersionfindByItem(Context context, Item item)List<Version>findVersionsWithItems(Context context, VersionHistory versionHistory, int offset, int limit)This method returns all versions of an version history that have items assigned.intgetNextVersionNumber(Context c, VersionHistory vh)-
Methods inherited from class org.dspace.core.AbstractHibernateDAO
count, count, countLong, create, createQuery, delete, executeCriteriaQuery, findAll, findAll, findByID, findByID, findByX, findMany, findMany, findUnique, getCriteriaBuilder, getCriteriaQuery, getHibernateSession, iterate, list, list, list, list, save, singleResult, singleResult, uniqueResult, uniqueResult
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.dspace.core.GenericDAO
create, delete, findAll, findAll, findByID, findByID, findMany, findUnique, save
-
-
-
-
Method Detail
-
findByItem
public Version findByItem(Context context, Item item) throws SQLException
- Specified by:
findByItemin interfaceVersionDAO- Throws:
SQLException
-
getNextVersionNumber
public int getNextVersionNumber(Context c, VersionHistory vh) throws SQLException
- Specified by:
getNextVersionNumberin interfaceVersionDAO- Throws:
SQLException
-
findVersionsWithItems
public List<Version> findVersionsWithItems(Context context, VersionHistory versionHistory, int offset, int limit) throws SQLException
Description copied from interface:VersionDAOThis method returns all versions of an version history that have items assigned. We do not delete versions to keep version numbers stable. To remove a version we set the item, date, summary and eperson null. This method returns only versions that aren't soft deleted and have items assigned.- Specified by:
findVersionsWithItemsin interfaceVersionDAO- Parameters:
context- The relevant DSpace Context.versionHistory- version historyoffset- the position of the first result to returnlimit- paging limit- Returns:
- all versions of an version history that have items assigned.
- Throws:
SQLException- An exception that provides information on a database access error or other errors.
-
countVersionsByHistoryWithItem
public int countVersionsByHistoryWithItem(Context context, VersionHistory versionHistory) throws SQLException
Description copied from interface:VersionDAOThis method count versions of an version history that have items assigned. We do not delete versions to keep version numbers stable. To remove a version we set the item, date, summary and eperson null. This method returns only versions that aren't soft deleted and have items assigned.- Specified by:
countVersionsByHistoryWithItemin interfaceVersionDAO- Parameters:
context- The relevant DSpace Context.versionHistory- Version history- Returns:
- Total versions of an version history that have items assigned.
- Throws:
SQLException- If database error
-
-