Package com.logicaldoc.chat
Class HibernateChatMessageDAO
java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<ChatMessage>
com.logicaldoc.chat.HibernateChatMessageDAO
- All Implemented Interfaces:
ChatMessageDAO
,com.logicaldoc.core.PersistentObjectDAO<ChatMessage>
public class HibernateChatMessageDAO
extends com.logicaldoc.core.HibernatePersistentObjectDAO<ChatMessage>
implements ChatMessageDAO
Hibernate implementation of
ChatMessageyDAO
- Since:
- 8.0.1
- Author:
- Alessandro Gasparini - LogicalDOC
-
Field Summary
Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO
ENTITY
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanOldMessages
(int ttl) This method deletes all the chat entries oldest than the given days from now.findLatest
(long tenantId, Integer max) This method selects all latest messagesvoid
store
(ChatMessage message) 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, getDatabaseMetadata, getDbms, getSessionFactory, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, 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, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForRowSet, queryForString
-
Method Details
-
findLatest
public List<ChatMessage> findLatest(long tenantId, Integer max) throws com.logicaldoc.core.PersistenceException Description copied from interface:ChatMessageDAO
This method selects all latest messages- Specified by:
findLatest
in interfaceChatMessageDAO
- Parameters:
tenantId
- identifier of the tenantmax
- optional maximum number of records- Returns:
- list of messages ordered by descending date
- Throws:
com.logicaldoc.core.PersistenceException
- Error in the data layer
-
cleanOldMessages
public void cleanOldMessages(int ttl) throws com.logicaldoc.core.PersistenceException Description copied from interface:ChatMessageDAO
This method deletes all the chat entries oldest than the given days from now. Ifttl
is 0 or -1, the cancellation is not made- Specified by:
cleanOldMessages
in interfaceChatMessageDAO
- Parameters:
ttl
- The maximum number of days over which the history is considered old- Throws:
com.logicaldoc.core.PersistenceException
- Error in the data layer
-
store
- Specified by:
store
in interfacecom.logicaldoc.core.PersistentObjectDAO<ChatMessage>
- Overrides:
store
in classcom.logicaldoc.core.HibernatePersistentObjectDAO<ChatMessage>
- Throws:
com.logicaldoc.core.PersistenceException
-