Class MessageDAO
java.lang.Object
ru.bgcrm.dao.CommonDAO
ru.bgcrm.dao.message.MessageDAO
- Direct Known Subclasses:
MessageSearchDAO
Message DAO
-
Nested Class Summary
Nested classes/interfaces inherited from class CommonDAO
CommonDAO.ObjectExtractor<T>, CommonDAO.RecordUpdater<T> -
Field Summary
Fields inherited from class CommonDAO
con, log, SQL_AND, SQL_DELETE, SQL_DELETE_FROM, SQL_DESC, SQL_DISTINCT, SQL_FROM, SQL_GROUP_BY, SQL_INNER_JOIN, SQL_INSERT_IGNORE_INTO, SQL_INSERT_INTO, SQL_LEFT_JOIN, SQL_LIMIT, SQL_ON_DUP_KEY_UPDATE, SQL_ORDER_BY, SQL_REPLACE, SQL_SELECT, SQL_SELECT_ALL_FROM, SQL_SELECT_COUNT_ROWS, SQL_SET, SQL_UNION_ALL, SQL_UPDATE, SQL_VALUES, SQL_VALUES_1, SQL_VALUES_2, SQL_VALUES_3, SQL_VALUES_4, SQL_VALUES_5, SQL_WHERE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteMessage(int id) Deletes all message related entities and attached filesvoiddeleteProcessMessages(int processId) Deletes process related messages and all related to them entitiesstatic StringgetMessageById(int id) Selects a message by IDgetMessageBySystemId(int typeId, String systemId) Selects a message by system IDstatic MessagegetMessageFromRs(ResultSet rs, String prefix) getMessageTags(int messageId) Selects message tagsgetProcessMessageList(int processId, int beforeMessageId) Retrieves process message list, sorted by IDgetProcessMessageList(Set<Integer> processIds, String text) Searches messages in processesgetProcessMessageTagMap(int processId) getProcessMessageTagMap(Collection<Integer> processIds) getUnsendMessageList(int type, int maxCount) voidsearchMessageList(Pageable<Message> searchResult, Integer processId, Integer typeId, Integer direction, Boolean processed, Boolean withAttach, Date dateFrom, Date dateTo, String from) Deprecated.voidsearchMessageList(Pageable<Message> searchResult, Integer processId, Integer typeId, Integer direction, Boolean processed, Boolean withAttach, Date dateFrom, Date dateTo, String from, boolean reverseOrder) Deprecated.voidsearchMessageList(Pageable<Message> searchResult, Integer processId, Integer typeId, Integer direction, Boolean processed, Boolean withAttach, Date dateFrom, Date dateTo, String from, boolean reverseOrder, Set<Integer> tagIds) Deprecated.voidsearchMessageList(Pageable<Message> searchResult, Collection<Integer> processIds, Integer typeId, Integer direction, Boolean processed, Boolean withAttach, Date dateFrom, Date dateTo, String from, boolean reverseOrder, Set<Integer> tagIds) Deprecated.voidsearchMessageList(Pageable<Message> searchResult, Collection<Integer> processIds, Set<Integer> typeIds, Integer direction, Boolean processed, Boolean withAttach, Date dateFrom, Date dateTo, String from, boolean reverseOrder, Set<Integer> tagIds) Deprecated.voidtoggleMessageTags(int messageId, Set<Integer> tagIds, boolean add) Adds or removes message tagsvoidupdateMessage(Message message) Updates message entityvoidupdateMessageProcess(Message message) Marks a message as processed (related to process)voidupdateMessageTags(int messageId, Set<Integer> tagIds, boolean positiveOnly) Updates message tagsMethods inherited from class CommonDAO
deleteById, foundRows, getById, getGroupedIds, getGroupedIds, getIds, getIds, getPageLimit, getPeriodSql, lastInsertId, setPeriodParamValue, setRecordCount, update, updateColumn, updateIds, updateIds, updateOrInsert
-
Constructor Details
-
MessageDAO
-
MessageDAO
-
-
Method Details
-
getMessageById
Selects a message by ID- Parameters:
id- the message ID- Returns:
- the message, or
nullif not found - Throws:
SQLException
-
getMessageBySystemId
Selects a message by system ID- Parameters:
typeId- the message type IDsystemId- the external system ID- Returns:
- the message, or
nullif not found - Throws:
SQLException
-
updateMessage
Updates message entity- Parameters:
message- the message- Throws:
SQLException
-
updateMessageProcess
Marks a message as processed (related to process)- Parameters:
message- the message- Throws:
SQLException
-
updateMessageTags
public void updateMessageTags(int messageId, Set<Integer> tagIds, boolean positiveOnly) throws SQLException Updates message tags- Parameters:
messageId- the message IDtagIds- the tag IDspositiveOnly- only positive tags will be deleted before insertion- Throws:
SQLException
-
toggleMessageTags
Adds or removes message tags- Parameters:
messageId- the message IDtagIds- the tag IDsadd- add or delete- Throws:
SQLException
-
getMessageTags
Selects message tags- Parameters:
messageId- the message ID- Returns:
- the tag IDs
- Throws:
SQLException
-
deleteMessage
Deletes all message related entities and attached files- Parameters:
id- the message ID- Throws:
SQLExceptionException
-
deleteProcessMessages
Deletes process related messages and all related to them entities- Parameters:
processId- process ID- Throws:
SQLException
-
getUnsendMessageList
-
searchMessageList
-
searchMessageList
-
searchMessageList
-
searchMessageList
@Deprecated public void searchMessageList(Pageable<Message> searchResult, Collection<Integer> processIds, Integer typeId, Integer direction, Boolean processed, Boolean withAttach, Date dateFrom, Date dateTo, String from, boolean reverseOrder, Set<Integer> tagIds) Deprecated.UseMessageSearchDAO -
searchMessageList
@Deprecated public void searchMessageList(Pageable<Message> searchResult, Collection<Integer> processIds, Set<Integer> typeIds, Integer direction, Boolean processed, Boolean withAttach, Date dateFrom, Date dateTo, String from, boolean reverseOrder, Set<Integer> tagIds) Deprecated.UseMessageSearchDAO -
getProcessMessageList
-
getProcessMessageTagMap
- Throws:
SQLException
-
getProcessMessageTagMap
public Map<Integer, Set<Integer>> getProcessMessageTagMap(Collection<Integer> processIds) throws SQLException - Throws:
SQLException
-
getProcessMessageList
-
getIsolationJoin
-
getMessageFromRs
- Throws:
SQLException
-