Package org.dspace.eperson.dao.impl
Class SubscriptionDAOImpl
- java.lang.Object
-
- org.dspace.core.AbstractHibernateDAO<Subscription>
-
- org.dspace.eperson.dao.impl.SubscriptionDAOImpl
-
- All Implemented Interfaces:
GenericDAO<Subscription>,SubscriptionDAO
public class SubscriptionDAOImpl extends AbstractHibernateDAO<Subscription> implements SubscriptionDAO
Hibernate implementation of the Database Access Object interface class for the Subscription object. This class is responsible for all database calls for the Subscription object and is autowired by spring This class should never be accessed directly.- Author:
- kevinvandevelde at atmire.com
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSubscriptionDAOImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LongcountAll(Context context)Count all subscriptionsLongcountAllByEPerson(Context context, EPerson ePerson)Count all subscriptions belong to an ePersonLongcountAllByEPersonAndDso(Context context, EPerson ePerson, DSpaceObject dSpaceObject)Count all subscriptions related to a DSpaceObject belong to an ePersonvoiddeleteByDSOAndEPerson(Context context, DSpaceObject dSpaceObject, EPerson eperson)Delete all subscriptions related to a DSpaceObject belong to an ePersonvoiddeleteByDspaceObject(Context context, DSpaceObject dSpaceObject)Delete all subscription of provided dSpaceObjectvoiddeleteByEPerson(Context context, EPerson eperson)Delete all subscription of provided ePersonList<Subscription>findAllOrderedByDSO(Context context, Integer limit, Integer offset)Return a paginated list of subscriptions ordered by DSpaceObjectList<Subscription>findAllOrderedByIDAndResourceType(Context context, String resourceType, Integer limit, Integer offset)Return a paginated list of all subscriptions ordered by ID and resourceTypeList<Subscription>findAllSubscriptionsBySubscriptionTypeAndFrequency(Context context, String subscriptionType, String frequencyValue)Return a list of all subscriptions by subscriptionType and frequencyList<Subscription>findByEPerson(Context context, EPerson eperson, Integer limit, Integer offset)Return a paginated list of all subscriptions of the epersonList<Subscription>findByEPersonAndDso(Context context, EPerson eperson, DSpaceObject dSpaceObject, Integer limit, Integer offset)Return a paginated list of subscriptions related to a DSpaceObject belong to an ePerson-
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
-
findByEPerson
public List<Subscription> findByEPerson(Context context, EPerson eperson, Integer limit, Integer offset) throws SQLException
Description copied from interface:SubscriptionDAOReturn a paginated list of all subscriptions of the eperson- Specified by:
findByEPersonin interfaceSubscriptionDAO- Parameters:
context- DSpace context objecteperson- ePerson whose subscriptions want to findlimit- Paging limitoffset- The position of the first result to return- Returns:
- Throws:
SQLException- If database error
-
findByEPersonAndDso
public List<Subscription> findByEPersonAndDso(Context context, EPerson eperson, DSpaceObject dSpaceObject, Integer limit, Integer offset) throws SQLException
Description copied from interface:SubscriptionDAOReturn a paginated list of subscriptions related to a DSpaceObject belong to an ePerson- Specified by:
findByEPersonAndDsoin interfaceSubscriptionDAO- Parameters:
context- DSpace context objecteperson- ePerson whose subscriptions want to finddSpaceObject- DSpaceObject of whom subscriptions want to findlimit- Paging limitoffset- The position of the first result to return- Returns:
- Throws:
SQLException- If database error
-
deleteByDspaceObject
public void deleteByDspaceObject(Context context, DSpaceObject dSpaceObject) throws SQLException
Description copied from interface:SubscriptionDAODelete all subscription of provided dSpaceObject- Specified by:
deleteByDspaceObjectin interfaceSubscriptionDAO- Parameters:
context- DSpace context objectdSpaceObject- DSpace resource- Throws:
SQLException- If database error
-
deleteByEPerson
public void deleteByEPerson(Context context, EPerson eperson) throws SQLException
Description copied from interface:SubscriptionDAODelete all subscription of provided ePerson- Specified by:
deleteByEPersonin interfaceSubscriptionDAO- Parameters:
context- DSpace context objecteperson- ePerson whose subscriptions want to delete- Throws:
SQLException- If database error
-
deleteByDSOAndEPerson
public void deleteByDSOAndEPerson(Context context, DSpaceObject dSpaceObject, EPerson eperson) throws SQLException
Description copied from interface:SubscriptionDAODelete all subscriptions related to a DSpaceObject belong to an ePerson- Specified by:
deleteByDSOAndEPersonin interfaceSubscriptionDAO- Parameters:
context- DSpace context objectdSpaceObject- DSpaceObject of whom subscriptions want to deleteeperson- ePerson whose subscriptions want to delete- Throws:
SQLException- If database error
-
findAllOrderedByIDAndResourceType
public List<Subscription> findAllOrderedByIDAndResourceType(Context context, String resourceType, Integer limit, Integer offset) throws SQLException
Description copied from interface:SubscriptionDAOReturn a paginated list of all subscriptions ordered by ID and resourceType- Specified by:
findAllOrderedByIDAndResourceTypein interfaceSubscriptionDAO- Parameters:
context- DSpace context objectresourceType- Could be Collection or Communitylimit- Paging limitoffset- The position of the first result to return- Returns:
- Throws:
SQLException- If database error
-
findAllOrderedByDSO
public List<Subscription> findAllOrderedByDSO(Context context, Integer limit, Integer offset) throws SQLException
Description copied from interface:SubscriptionDAOReturn a paginated list of subscriptions ordered by DSpaceObject- Specified by:
findAllOrderedByDSOin interfaceSubscriptionDAO- Parameters:
context- DSpace context objectlimit- Paging limitoffset- The position of the first result to return- Returns:
- Throws:
SQLException- If database error
-
findAllSubscriptionsBySubscriptionTypeAndFrequency
public List<Subscription> findAllSubscriptionsBySubscriptionTypeAndFrequency(Context context, String subscriptionType, String frequencyValue) throws SQLException
Description copied from interface:SubscriptionDAOReturn a list of all subscriptions by subscriptionType and frequency- Specified by:
findAllSubscriptionsBySubscriptionTypeAndFrequencyin interfaceSubscriptionDAO- Parameters:
context- DSpace context objectsubscriptionType- Could be "content" or "statistics". NOTE: in DSpace we have only "content"frequencyValue- Could be "D" stand for Day, "W" stand for Week, and "M" stand for Month- Returns:
- Throws:
SQLException- If database error
-
countAll
public Long countAll(Context context) throws SQLException
Description copied from interface:SubscriptionDAOCount all subscriptions- Specified by:
countAllin interfaceSubscriptionDAO- Parameters:
context- DSpace context object- Returns:
- Total of all subscriptions
- Throws:
SQLException- If database error
-
countAllByEPerson
public Long countAllByEPerson(Context context, EPerson ePerson) throws SQLException
Description copied from interface:SubscriptionDAOCount all subscriptions belong to an ePerson- Specified by:
countAllByEPersonin interfaceSubscriptionDAO- Parameters:
context- DSpace context objectePerson- ePerson whose subscriptions want count- Returns:
- Total of all subscriptions belong to an ePerson
- Throws:
SQLException- If database error
-
countAllByEPersonAndDso
public Long countAllByEPersonAndDso(Context context, EPerson ePerson, DSpaceObject dSpaceObject) throws SQLException
Description copied from interface:SubscriptionDAOCount all subscriptions related to a DSpaceObject belong to an ePerson- Specified by:
countAllByEPersonAndDsoin interfaceSubscriptionDAO- Parameters:
context- DSpace context objectePerson- ePerson whose subscriptions want countdSpaceObject- DSpaceObject of whom subscriptions want count- Returns:
- Throws:
SQLException- If database error
-
-