Class HibernateSystemMessageDAO
java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<SystemMessage>
com.logicaldoc.core.communication.HibernateSystemMessageDAO
- All Implemented Interfaces:
SystemMessageDAO
,PersistentObjectDAO<SystemMessage>
public class HibernateSystemMessageDAO
extends HibernatePersistentObjectDAO<SystemMessage>
implements SystemMessageDAO
Hibernate implementation of
SystemMessageDAO
- Since:
- 3.0
- Author:
- Marco Meschieri - LogicalDOC
-
Nested Class Summary
-
Field Summary
Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO
ENTITY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteExpiredMessages
(int type) Removes all expired messages for the specified typevoid
deleteExpiredMessages
(String recipient) Removes all system expired messages for the specified recipientfindByMode
(String mode) This method selects all the messages for the specified modefindByRecipient
(String recipient, int type, Integer read) This method selects all the messages for the specified recipient and typefindByType
(int type) This method selects all the messages for the specified typefindMessagesToBeSent
(int type, int maxTrial) This method selects all the messages for the specified type that are not been already sent and for which the number of sending trials is less than the maximum number (parameter 'notifier.maxtrials')int
getUnreadCount
(String recipient, int type) This methods gets the number of unread messages for the specified recipient and type.void
initialize
(SystemMessage message) Doesn't do anything by defaultvoid
store
(SystemMessage message) This method persists the entity objectMethods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO
bulkUpdate, delete, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, getSessionFactory, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForRowSet, queryForString, setSessionFactory
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.logicaldoc.core.PersistentObjectDAO
bulkUpdate, delete, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForRowSet, queryForString
-
Constructor Details
-
HibernateSystemMessageDAO
public HibernateSystemMessageDAO()
-
-
Method Details
-
findByRecipient
Description copied from interface:SystemMessageDAO
This method selects all the messages for the specified recipient and type- Specified by:
findByRecipient
in interfaceSystemMessageDAO
- Parameters:
recipient
- The recipient nametype
- The message typeread
- Optional flag- Returns:
- The messages list
-
getUnreadCount
Description copied from interface:SystemMessageDAO
This methods gets the number of unread messages for the specified recipient and type.- Specified by:
getUnreadCount
in interfaceSystemMessageDAO
- Parameters:
recipient
- The recipient nametype
- The message type- Returns:
- The number of messages
-
deleteExpiredMessages
Description copied from interface:SystemMessageDAO
Removes all system expired messages for the specified recipient- Specified by:
deleteExpiredMessages
in interfaceSystemMessageDAO
- Parameters:
recipient
- The recipient- See Also:
-
deleteExpiredMessages
public void deleteExpiredMessages(int type) Description copied from interface:SystemMessageDAO
Removes all expired messages for the specified type- Specified by:
deleteExpiredMessages
in interfaceSystemMessageDAO
- Parameters:
type
- The message type- See Also:
-
findByMode
Description copied from interface:SystemMessageDAO
This method selects all the messages for the specified mode- Specified by:
findByMode
in interfaceSystemMessageDAO
- Parameters:
mode
- The message mode- Returns:
- The list of messages of the given mode
-
findByType
Description copied from interface:SystemMessageDAO
This method selects all the messages for the specified type- Specified by:
findByType
in interfaceSystemMessageDAO
- Parameters:
type
- type of the message- Returns:
- The list of messages with the given type
-
initialize
Description copied from class:HibernatePersistentObjectDAO
Doesn't do anything by default- Specified by:
initialize
in interfacePersistentObjectDAO<SystemMessage>
- Overrides:
initialize
in classHibernatePersistentObjectDAO<SystemMessage>
- Parameters:
message
- The entity to be initialised
-
findMessagesToBeSent
Description copied from interface:SystemMessageDAO
This method selects all the messages for the specified type that are not been already sent and for which the number of sending trials is less than the maximum number (parameter 'notifier.maxtrials')- Specified by:
findMessagesToBeSent
in interfaceSystemMessageDAO
- Parameters:
type
- The message typemaxTrial
- The maximum number of sending trials- Returns:
- The list of messages of the given type
-
store
Description copied from interface:PersistentObjectDAO
This method persists the entity object- Specified by:
store
in interfacePersistentObjectDAO<SystemMessage>
- Overrides:
store
in classHibernatePersistentObjectDAO<SystemMessage>
- Parameters:
message
- entity to be stored- Throws:
PersistenceException
- raised in case of errors in the database
-