Class 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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cleanOldMessages​(int ttl)
      This method deletes all the chat entries oldest than the given days from now.
      List<ChatMessage> findLatest​(long tenantId, Integer max)
      This method selects all latest messages
      void store​(ChatMessage message)  
      • Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO

        bulkUpdate, bulkUpdate, delete, 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
      • Methods inherited from interface com.logicaldoc.core.PersistentObjectDAO

        bulkUpdate, bulkUpdate, delete, 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
    • Method Detail

      • findLatest

        public List<ChatMessage> findLatest​(long tenantId,
                                            Integer max)
        Description copied from interface: ChatMessageDAO
        This method selects all latest messages
        Specified by:
        findLatest in interface ChatMessageDAO
        Parameters:
        tenantId - identifier of the tenant
        max - optional maximum number of records
        Returns:
        list of messages ordered by descending date
      • cleanOldMessages

        public void cleanOldMessages​(int ttl)
        Description copied from interface: ChatMessageDAO
        This method deletes all the chat entries oldest than the given days from now. If ttl is 0 or -1, the cancellation is not made
        Specified by:
        cleanOldMessages in interface ChatMessageDAO
        Parameters:
        ttl - The maximum number of days over which the history is considered old
      • store

        public void store​(ChatMessage message)
                   throws com.logicaldoc.core.PersistenceException
        Specified by:
        store in interface com.logicaldoc.core.PersistentObjectDAO<ChatMessage>
        Overrides:
        store in class com.logicaldoc.core.HibernatePersistentObjectDAO<ChatMessage>
        Throws:
        com.logicaldoc.core.PersistenceException