Package org.dspace.eperson.dao.impl
Class 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 -
Method Summary
Modifier and TypeMethodDescriptionCount all subscriptionscountAllByEPerson(Context context, EPerson ePerson) Count all subscriptions belong to an ePersoncountAllByEPersonAndDso(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 ePersonfindAllOrderedByDSO(Context context, Integer limit, Integer offset) Return a paginated list of subscriptions ordered by DSpaceObjectfindAllOrderedByIDAndResourceType(Context context, String resourceType, Integer limit, Integer offset) Return a paginated list of all subscriptions ordered by ID and resourceTypefindAllSubscriptionsBySubscriptionTypeAndFrequency(Context context, String subscriptionType, String frequencyValue) Return a list of all subscriptions by subscriptionType and frequencyfindByEPerson(Context context, EPerson eperson, Integer limit, Integer offset) Return a paginated list of all subscriptions of the epersonfindByEPersonAndDso(Context context, EPerson eperson, DSpaceObject dSpaceObject, Integer limit, Integer offset) Return a paginated list of subscriptions related to a DSpaceObject belong to an ePersonMethods inherited from class org.dspace.core.AbstractHibernateDAO
count, count, countLong, create, createQuery, createQuery, delete, executeCriteriaQuery, findAll, findAll, findByID, findByID, findByID, findByX, findMany, findMany, findUnique, getCriteriaBuilder, getCriteriaQuery, getHibernateSession, iterate, list, list, list, list, save, singleResult, singleResult, uniqueResult, uniqueResult
-
Constructor Details
-
SubscriptionDAOImpl
protected SubscriptionDAOImpl()
-
-
Method Details
-
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
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
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
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
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
-