Class FormRecordMessageDao
java.lang.Object
- All Implemented Interfaces:
de.xima.cmn.dao.interfaces.IAbstractDao<FormRecordMessage, Long, IEntityContext>, IFormRecordMessageDao, IGenericDao<FormRecordMessage>
public class FormRecordMessageDao
extends GenericDao<FormRecordMessage>
implements IFormRecordMessageDao
Implementation of the
IFormRecordMessageDao for reading and writing FormRecordMessage entities.- Since:
- 8.2.0
- Author:
- XIMA Media GmbH
-
Field Summary
FieldsFields inherited from class de.xima.cmn.dao.AbstractDao
entityClass, LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAllBySenderUserProfile(IEntityContext ec, UserProfile sender) Returns all messages sent by the given user profile.getByChatAndUser(IEntityContext ec, UUID chatUuid, IUser user, int page, int pageSize) Finds the messages for the form record chat given by its UUID if the given usercan access the chat.getByUser(IEntityContext ec, IUser user) Returns all messages the given user has access to.getByUser(IEntityContext ec, IUser user, int page, int pageSize) Deprecated.getByUuid(IEntityContext ec, UUID uuid) Finds the message for the given UUID.getByUuidAndUser(IEntityContext ec, UUID uuid, IUser requestingUser) Finds the message for the given UUID, which the givenuser can access.getChatMessages(IEntityContext ec, UUID chatUuid) Returns all messages for the given chat UUID ordered by their sent instant (desc).getDetailsByUuidAndUser(IEntityContext ec, UUID uuid, IUser user, Locale locale) Returns the detailed form record message for the given UUID.getMessagePage(IEntityContext ec, PageQuery pageQuery, FormRecordMessagesQuery messagesQuery, boolean skipCount) Returns a page of form record messages for the given page query and messages query.protected IFCDaoActionHook<FormRecordMessage> protected IFCDaoActionHook<FormRecordMessage> getUnreadByUser(IEntityContext ec, IUser user, int page, int pageSize) Finds all unread form record messages the given user has access to.Methods inherited from class GenericDao
getEntityRefs, readMethods inherited from class de.xima.cmn.dao.AbstractDao
all, bulkDelete, bulkUpdate, cb, checkLockingVersion, cq, create, create, delete, delete, deleteAll, executePagedDaoAction, getAttributes, getAttributes, getSingleAttributes, getSingleAttributes, getTransactionHandler, notifyListener, notifyListener, read, registerListener, registerListener, registerListener, resultTotalCount, setTransactionHandler, singleElement, unregisterListener, unregisterListener, unregisterListener, update, updateMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.xima.cmn.dao.interfaces.IAbstractDao
all, bulkDelete, bulkUpdate, checkLockingVersion, create, create, delete, delete, deleteAll, executePagedDaoAction, getAttributes, getAttributes, getSingleAttributes, getSingleAttributes, getTransactionHandler, read, registerListener, registerListener, registerListener, resultTotalCount, setTransactionHandler, singleElement, unregisterListener, unregisterListener, unregisterListener, update, updateMethods inherited from interface IGenericDao
count, createOrUpdate, findAll, findSingle, getEntityRefs, read
-
Field Details
-
SKIP_UPDATE_PROTOCOL_ENTRY
- See Also:
-
-
Constructor Details
-
FormRecordMessageDao
public FormRecordMessageDao()
-
-
Method Details
-
getAllBySenderUserProfile
Description copied from interface:IFormRecordMessageDaoReturns all messages sent by the given user profile.- Specified by:
getAllBySenderUserProfilein interfaceIFormRecordMessageDao- Parameters:
ec- the entity contextsender- the user profile of the sender- Returns:
- all messages of the sender
-
getByChatAndUser
public PagedResult<FormRecordMessage> getByChatAndUser(IEntityContext ec, UUID chatUuid, IUser user, int page, int pageSize) Description copied from interface:IFormRecordMessageDaoFinds the messages for the form record chat given by its UUID if the given usercan access the chat.- Specified by:
getByChatAndUserin interfaceIFormRecordMessageDao- Parameters:
ec- entity context for accessing the database.chatUuid- the UUID of the chatuser- to get the form record messages for.page- to get.pageSize- size of the page to get.- Returns:
- a list of form record messages the user has access to ordered by their creation instant (desc).
nullif the chat given by the UUID could not be found. - See Also:
-
getByUser
Description copied from interface:IFormRecordMessageDaoReturns all messages the given user has access to. The user has access to all messages ofchats they have accessto.- Specified by:
getByUserin interfaceIFormRecordMessageDao- Parameters:
ec- entity context for accessing the database.user- requesting the messages.- Returns:
- a list of form record messages ordered by their
sent instant(desc). - See Also:
-
getByUser
@Deprecated public PagedResult<FormRecordMessage> getByUser(IEntityContext ec, IUser user, int page, int pageSize) Deprecated.Description copied from interface:IFormRecordMessageDaoFinds all form record messages the given user has access to.- Specified by:
getByUserin interfaceIFormRecordMessageDao- Parameters:
ec- entity context for database transactions.user- to get the form record messages for.page- to get.pageSize- size of the page to get.- Returns:
- a list of form record messages the user has access to ordered by their creation instant (desc).
- See Also:
-
getByUuid
Description copied from interface:IFormRecordMessageDaoFinds the message for the given UUID.- Specified by:
getByUuidin interfaceIFormRecordMessageDao- Parameters:
ec- entity context for accessing the databaseuuid- the UUID of the message- Returns:
- The message with the given UUID
-
getByUuidAndUser
Description copied from interface:IFormRecordMessageDaoFinds the message for the given UUID, which the givenuser can access.- Specified by:
getByUuidAndUserin interfaceIFormRecordMessageDao- Parameters:
ec- entity context for accessing the databaseuuid- the UUID of the messagerequestingUser- user requesting the messages.- Returns:
- The message with the given UUID which the given user can access and
nullotherwise. - See Also:
-
getChatMessages
Description copied from interface:IFormRecordMessageDaoReturns all messages for the given chat UUID ordered by their sent instant (desc). This is intended for displaying the chat in the backoffice inbox.- Specified by:
getChatMessagesin interfaceIFormRecordMessageDao- Parameters:
ec- entity context for accessing the databasechatUuid- the UUID of the chat- Returns:
- a list of all form record messages for the chat ordered by their sent instant (desc).
-
getDetailsByUuidAndUser
public DetailedFormRecordMessageDTO getDetailsByUuidAndUser(IEntityContext ec, UUID uuid, IUser user, Locale locale) Description copied from interface:IFormRecordMessageDaoReturns the detailed form record message for the given UUID.- Specified by:
getDetailsByUuidAndUserin interfaceIFormRecordMessageDao- Parameters:
ec- entity context for accessing the databaseuuid- the UUID of the messageuser- user requesting the messages.locale- the locale for which to return the message (metadata)- Returns:
- The detailed form record message with the given UUID
-
getMessagePage
public PagedResult<BaseFormRecordMessageDTO> getMessagePage(IEntityContext ec, PageQuery pageQuery, FormRecordMessagesQuery messagesQuery, boolean skipCount) Description copied from interface:IFormRecordMessageDaoReturns a page of form record messages for the given page query and messages query.- Specified by:
getMessagePagein interfaceIFormRecordMessageDao- Parameters:
ec- entity context for database transactions.pageQuery- page query to get the messages.messagesQuery- messagesQuery to apply to the messages.skipCount- whether to skip the count query.- Returns:
- a list of form record messages in the order defined by the messages query.
-
getUnreadByUser
public PagedResult<FormRecordMessage> getUnreadByUser(IEntityContext ec, IUser user, int page, int pageSize) Description copied from interface:IFormRecordMessageDaoFinds all unread form record messages the given user has access to. Unread messages can only be gotten for users withUserProfiles. For users without a profile all messages will be returned.- Specified by:
getUnreadByUserin interfaceIFormRecordMessageDao- Parameters:
ec- entity context for database transactions.user- to get the unread form record messages for.page- to get.pageSize- size of the page to get.- Returns:
- a list of form record messages the user has access to ordered by their creation instant (desc).
- See Also:
-
getPostActionHook
- Overrides:
getPostActionHookin classGenericDao<FormRecordMessage>
-
getPreActionHook
- Overrides:
getPreActionHookin classGenericDao<FormRecordMessage>
-