Package org.dspace.eperson.dao
Interface SubscriptionDAO
-
- All Superinterfaces:
GenericDAO<Subscription>
- All Known Implementing Classes:
SubscriptionDAOImpl
public interface SubscriptionDAO extends GenericDAO<Subscription>
Database Access Object interface class for the Subscription object. The implementation of this class is responsible for all database calls for the Subscription object and is autowired by spring This class should only be accessed from a single service and should never be exposed outside of the API- Author:
- kevinvandevelde at atmire.com
-
-
Method Summary
All Methods Instance Methods Abstract 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 interface org.dspace.core.GenericDAO
create, delete, findAll, findAll, findByID, findByID, findMany, findUnique, save
-
-
-
-
Method Detail
-
deleteByDspaceObject
void deleteByDspaceObject(Context context, DSpaceObject dSpaceObject) throws SQLException
Delete all subscription of provided dSpaceObject- Parameters:
context- DSpace context objectdSpaceObject- DSpace resource- Throws:
SQLException- If database error
-
findByEPerson
List<Subscription> findByEPerson(Context context, EPerson eperson, Integer limit, Integer offset) throws SQLException
Return a paginated list of all subscriptions of the eperson- 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
List<Subscription> findByEPersonAndDso(Context context, EPerson eperson, DSpaceObject dSpaceObject, Integer limit, Integer offset) throws SQLException
Return a paginated list of subscriptions related to a DSpaceObject belong to an ePerson- 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
-
deleteByEPerson
void deleteByEPerson(Context context, EPerson eperson) throws SQLException
Delete all subscription of provided ePerson- Parameters:
context- DSpace context objecteperson- ePerson whose subscriptions want to delete- Throws:
SQLException- If database error
-
deleteByDSOAndEPerson
void deleteByDSOAndEPerson(Context context, DSpaceObject dSpaceObject, EPerson eperson) throws SQLException
Delete all subscriptions related to a DSpaceObject belong to an ePerson- Parameters:
context- DSpace context objectdSpaceObject- DSpaceObject of whom subscriptions want to deleteeperson- ePerson whose subscriptions want to delete- Throws:
SQLException- If database error
-
findAllOrderedByIDAndResourceType
List<Subscription> findAllOrderedByIDAndResourceType(Context context, String resourceType, Integer limit, Integer offset) throws SQLException
Return a paginated list of all subscriptions ordered by ID and resourceType- 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
List<Subscription> findAllOrderedByDSO(Context context, Integer limit, Integer offset) throws SQLException
Return a paginated list of subscriptions ordered by DSpaceObject- Parameters:
context- DSpace context objectlimit- Paging limitoffset- The position of the first result to return- Returns:
- Throws:
SQLException- If database error
-
findAllSubscriptionsBySubscriptionTypeAndFrequency
List<Subscription> findAllSubscriptionsBySubscriptionTypeAndFrequency(Context context, String subscriptionType, String frequencyValue) throws SQLException
Return a list of all subscriptions by subscriptionType and frequency- 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
Long countAll(Context context) throws SQLException
Count all subscriptions- Parameters:
context- DSpace context object- Returns:
- Total of all subscriptions
- Throws:
SQLException- If database error
-
countAllByEPerson
Long countAllByEPerson(Context context, EPerson ePerson) throws SQLException
Count all subscriptions belong to an ePerson- 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
Long countAllByEPersonAndDso(Context context, EPerson ePerson, DSpaceObject dSpaceObject) throws SQLException
Count all subscriptions related to a DSpaceObject belong to an ePerson- Parameters:
context- DSpace context objectePerson- ePerson whose subscriptions want countdSpaceObject- DSpaceObject of whom subscriptions want count- Returns:
- Throws:
SQLException- If database error
-
-