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 ofSystemMessageDAO- Since:
- 3.0
- Author:
- Marco Meschieri - LogicalDOC
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classHibernateSystemMessageDAO.SystemMessageMapper
-
Constructor Summary
Constructors Constructor Description HibernateSystemMessageDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteExpiredMessages(int type)Removes all expired messages for the specified typevoiddeleteExpiredMessages(String recipient)Removes all system expired messages for the specified recipientList<SystemMessage>findByMode(String mode)This method selects all the messages for the specified modeList<SystemMessage>findByRecipient(String recipient, int type, Integer read)This method selects all the messages for the specified recipient and typeList<SystemMessage>findByType(int type)This method selects all the messages for the specified typeList<SystemMessage>findMessagesToBeSent(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')intgetUnreadCount(String recipient, int type)This methods gets the number of unread messages for the specified recipient and type.voidinitialize(SystemMessage message)Doesn't do anything by defaultbooleanstore(SystemMessage message)This method persists the entity object-
Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO
bulkUpdate, delete, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, getSessionFactory, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForObject, 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, getDbms, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForObject, queryForRowSet, queryForString
-
-
-
-
Method Detail
-
findByRecipient
public List<SystemMessage> findByRecipient(String recipient, int type, Integer read)
Description copied from interface:SystemMessageDAOThis method selects all the messages for the specified recipient and type- Specified by:
findByRecipientin interfaceSystemMessageDAO- Parameters:
recipient- The recipient nametype- The message typeread- Optional flag- Returns:
- The messages list
-
getUnreadCount
public int getUnreadCount(String recipient, int type)
Description copied from interface:SystemMessageDAOThis methods gets the number of unread messages for the specified recipient and type.- Specified by:
getUnreadCountin interfaceSystemMessageDAO- Parameters:
recipient- The recipient nametype- The message type- Returns:
- The number of messages
-
deleteExpiredMessages
public void deleteExpiredMessages(String recipient)
Description copied from interface:SystemMessageDAORemoves all system expired messages for the specified recipient- Specified by:
deleteExpiredMessagesin interfaceSystemMessageDAO- Parameters:
recipient- The recipient- See Also:
SystemMessageDAO.deleteExpiredMessages(java.lang.String)
-
deleteExpiredMessages
public void deleteExpiredMessages(int type)
Description copied from interface:SystemMessageDAORemoves all expired messages for the specified type- Specified by:
deleteExpiredMessagesin interfaceSystemMessageDAO- Parameters:
type- The message type- See Also:
SystemMessageDAO.deleteExpiredMessages(int)
-
findByMode
public List<SystemMessage> findByMode(String mode)
Description copied from interface:SystemMessageDAOThis method selects all the messages for the specified mode- Specified by:
findByModein interfaceSystemMessageDAO- Parameters:
mode- The message mode- Returns:
- The list of messages of the given mode
-
findByType
public List<SystemMessage> findByType(int type)
Description copied from interface:SystemMessageDAOThis method selects all the messages for the specified type- Specified by:
findByTypein interfaceSystemMessageDAO- Parameters:
type- type of the message- Returns:
- The list of messages with the given type
-
initialize
public void initialize(SystemMessage message)
Description copied from class:HibernatePersistentObjectDAODoesn't do anything by default- Specified by:
initializein interfacePersistentObjectDAO<SystemMessage>- Overrides:
initializein classHibernatePersistentObjectDAO<SystemMessage>- Parameters:
message- The entity to be initialised
-
findMessagesToBeSent
public List<SystemMessage> findMessagesToBeSent(int type, int maxTrial)
Description copied from interface:SystemMessageDAOThis 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:
findMessagesToBeSentin interfaceSystemMessageDAO- Parameters:
type- The message typemaxTrial- The maximum number of sending trials- Returns:
- The list of messages of the given type
-
store
public boolean store(SystemMessage message) throws PersistenceException
Description copied from interface:PersistentObjectDAOThis method persists the entity object- Specified by:
storein interfacePersistentObjectDAO<SystemMessage>- Overrides:
storein classHibernatePersistentObjectDAO<SystemMessage>- Parameters:
message- entity to be stored- Returns:
- True if successfully stored in a database
- Throws:
PersistenceException- raised in case of errors in the database
-
-