Package com.logicaldoc.audit
Class HibernateSubscriptionDAO
java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<Subscription>
com.logicaldoc.audit.HibernateSubscriptionDAO
- All Implemented Interfaces:
- SubscriptionDAO,- com.logicaldoc.core.PersistentObjectDAO<Subscription>
@Repository("subscriptionDAO")
public class HibernateSubscriptionDAO
extends com.logicaldoc.core.HibernatePersistentObjectDAO<Subscription>
implements SubscriptionDAO
Hibernate implementation of the SubscriptionDAO.
- Since:
- 5.0
- Author:
- Matteo Caruso - LogicalDOC
- 
Field SummaryFields inherited from interface com.logicaldoc.core.PersistentObjectDAOENTITY
- 
Method SummaryModifier and TypeMethodDescriptionvoidThis method removes all the subscriptions associated to a deleted folder or documentvoiddelete(long subscriptionId, int code) Retrieves all the subscriptions matching a set of criteria.Retrieves all the subscriptions with the given alternate key.findByName(String name) Retrieves the subscription by the given namefindByObjectIdAndType(long objectId, String type, String event, Integer folderOption) Retrieves all the subscriptions with the given object id and the given typefindByType(String type) Retrieves all the subscriptions with the given typefindByUserId(long userId) This method selects all subscriptions of a given userMethods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAObulkUpdate, delete, deleteAll, deleteAll, evict, evict, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, initialize, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, queryForString, setSessionFactory, storeMethods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.logicaldoc.core.PersistentObjectDAObulkUpdate, delete, deleteAll, deleteAll, evict, evict, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, initialize, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, queryForString, store
- 
Method Details- 
findByNameDescription copied from interface:SubscriptionDAORetrieves the subscription by the given name- Specified by:
- findByNamein interface- SubscriptionDAO
- Parameters:
- name- The subscription name
- Returns:
- The subscription with the given name
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
findByTypeDescription copied from interface:SubscriptionDAORetrieves all the subscriptions with the given type- Specified by:
- findByTypein interface- SubscriptionDAO
- Parameters:
- type- The subscription type
- Returns:
- A list of subscriptions with the given type
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
deletepublic void delete(long subscriptionId, int code) throws com.logicaldoc.core.PersistenceException - Specified by:
- deletein interface- com.logicaldoc.core.PersistentObjectDAO<Subscription>
- Overrides:
- deletein class- com.logicaldoc.core.HibernatePersistentObjectDAO<Subscription>
- Throws:
- com.logicaldoc.core.PersistenceException
 
- 
findByAKpublic Subscription findByAK(long userId, long objectId, String type) throws com.logicaldoc.core.PersistenceException Description copied from interface:SubscriptionDAORetrieves all the subscriptions with the given alternate key.- Specified by:
- findByAKin 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
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
findByUserIdDescription copied from interface:SubscriptionDAOThis method selects all subscriptions of a given user- Specified by:
- findByUserIdin interface- SubscriptionDAO
- Parameters:
- userId- identifier of the user
- Returns:
- list of subscriptions ordered by date
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
cleanPendingSubscriptionspublic void cleanPendingSubscriptions() throws com.logicaldoc.core.PersistenceExceptionDescription copied from interface:SubscriptionDAOThis method removes all the subscriptions associated to a deleted folder or document- Specified by:
- cleanPendingSubscriptionsin interface- SubscriptionDAO
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
findByObjectIdAndTypepublic List<Subscription> findByObjectIdAndType(long objectId, String type, String event, Integer folderOption) throws com.logicaldoc.core.PersistenceException Description copied from interface:SubscriptionDAORetrieves all the subscriptions with the given object id and the given type- Specified by:
- findByObjectIdAndTypein 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
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
- 
findpublic List<Subscription> find(Long objectId, String type, String event, Long userId, Integer folderOption, Integer max) throws com.logicaldoc.core.PersistenceException Description copied from interface:SubscriptionDAORetrieves all the subscriptions matching a set of criteria.- Specified by:
- findin 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
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the database
 
 
-