Class HibernateSubscriptionDAO

  • All Implemented Interfaces:
    SubscriptionDAO, com.logicaldoc.core.PersistentObjectDAO<Subscription>

    public class HibernateSubscriptionDAO
    extends com.logicaldoc.core.HibernatePersistentObjectDAO<Subscription>
    implements SubscriptionDAO
    Hibernate implementation of the SubscriptionDAO.
    Since:
    5.0
    Author:
    Matteo Caruso - LogicalDOC
    • Field Summary

      • Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO

        ENTITY
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cleanPendingSubscriptions()
      This method removes all the subscriptions associated to a deleted folder or document
      void delete​(long subscriptionId, int code)  
      List<Subscription> find​(Long objectId, String type, String event, Long userId, Integer folderOption, Integer max)
      Retrieves all the subscriptions matching a set of criteria.
      Subscription findByAK​(long userId, long objectId, String type)
      Retrieves all the subscriptions with the given alternate key.
      Subscription findByName​(String name)
      Retrieves the subscription by the given name
      List<Subscription> findByObjectIdAndType​(long objectId, String type, String event, Integer folderOption)
      Retrieves all the subscriptions with the given object id and the given type
      List<Subscription> findByType​(String type)
      Retrieves all the subscriptions with the given type
      List<Subscription> findByUserId​(long userId)
      This method selects all subscriptions of a given user
      • Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO

        bulkUpdate, bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, getSessionFactory, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForString, setSessionFactory, store
      • Methods inherited from interface com.logicaldoc.core.PersistentObjectDAO

        bulkUpdate, bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForString, store
    • Method Detail

      • findByName

        public Subscription findByName​(String name)
        Description copied from interface: SubscriptionDAO
        Retrieves the subscription by the given name
        Specified by:
        findByName in interface SubscriptionDAO
        Parameters:
        name - The subscription name
        Returns:
        The subscription with the given name
      • findByType

        public List<Subscription> findByType​(String type)
        Description copied from interface: SubscriptionDAO
        Retrieves all the subscriptions with the given type
        Specified by:
        findByType in interface SubscriptionDAO
        Parameters:
        type - The subscription type
        Returns:
        A list of subscriptions with the given type
      • delete

        public void delete​(long subscriptionId,
                           int code)
                    throws com.logicaldoc.core.PersistenceException
        Specified by:
        delete in interface com.logicaldoc.core.PersistentObjectDAO<Subscription>
        Overrides:
        delete in class com.logicaldoc.core.HibernatePersistentObjectDAO<Subscription>
        Throws:
        com.logicaldoc.core.PersistenceException
      • findByAK

        public Subscription findByAK​(long userId,
                                     long objectId,
                                     String type)
        Description copied from interface: SubscriptionDAO
        Retrieves all the subscriptions with the given alternate key.
        Specified by:
        findByAK in interface SubscriptionDAO
        Parameters:
        userId - The subscription user id
        objectId - The subscription object id
        type - The subscription type
        Returns:
        The subscription with the given userId, objectId and type
      • cleanPendingSubscriptions

        public void cleanPendingSubscriptions()
        Description copied from interface: SubscriptionDAO
        This method removes all the subscriptions associated to a deleted folder or document
        Specified by:
        cleanPendingSubscriptions in interface SubscriptionDAO
      • findByObjectIdAndType

        public List<Subscription> findByObjectIdAndType​(long objectId,
                                                        String type,
                                                        String event,
                                                        Integer folderOption)
        Description copied from interface: SubscriptionDAO
        Retrieves all the subscriptions with the given object id and the given type
        Specified by:
        findByObjectIdAndType in interface SubscriptionDAO
        Parameters:
        objectId - The subscription object id
        type - The subscription type
        event - If used, indicates what type of events the returned subscriptions must refer to.
        folderOption - specification of the folder option.
        Returns:
        A list of subscriptions with the given objectId and the given type
      • find

        public List<Subscription> find​(Long objectId,
                                       String type,
                                       String event,
                                       Long userId,
                                       Integer folderOption,
                                       Integer max)
        Description copied from interface: SubscriptionDAO
        Retrieves all the subscriptions matching a set of criteria.
        Specified by:
        find in interface SubscriptionDAO
        Parameters:
        objectId - The subscription object id
        type - The subscription type
        event - If used, indicates what type of events the returned subscriptions must refer to.
        userId - The identifier of the subscribed user
        folderOption - specification of the folder option.
        max - maximum number of elements.
        Returns:
        A list of subscriptions