SFRMMessageDSDAO

public class SFRMMessageDSDAO extends DataSourceDAO implements SFRMMessageDAO

The data access object controller for the database table sfrm_message. It provides some useful database-level queries. Creation Date: 29/9/2006

Author:Twinsen Tsang

Methods

createDVO

public DVO createDVO()

Create a new SFRM Message record Object.

Returns:a new SFRM Message record Object.

findMessageByMessageBoxAndPartnershipIdAndStatus

public List findMessageByMessageBoxAndPartnershipIdAndStatus(String messageBox, String partnershipId, String status)

Find a list of message record according to the message box and partnership id and status.

Parameters:
  • messageBox – The message box of the message.
  • partnershipId – The partnership id of the message.
  • status – The status of the message.
Throws:
Returns:

a list of message record the satisfy this condition.

findMessageByMessageBoxAndStatus

public List findMessageByMessageBoxAndStatus(String messageBox, String status)

Find a message record according to the message box and it’s status

Parameters:
  • messageBox – The message box of message. it should be “INBOX” or “OUTBOX”.
  • status – The status of the message.
Throws:
Returns:

a list of message record that satisfy this condition.

findMessageByMessageIdAndBox

public SFRMMessageDVO findMessageByMessageIdAndBox(String messageId, String messageBox)

Find a message record with specified message id.

Parameters:
  • messageId – The message id of message to be found.
  • messageBox – The message box of message. it should be “INBOX” or “OUTBOX”.
Throws:
Returns:

return null if not found, otherwise a message record.

findMessageByMessageIdAndBox

public SFRMMessageDVO findMessageByMessageIdAndBox(SFRMMessageDVO message)

Find a message record with specified message record. The field “message id” and “message box” will be used for record finding.

Parameters:
  • message – The message record object to be used for searching.
Throws:
Returns:

return null if not found, otherwise a message record.

findMessageForAcknowledgement

public List findMessageForAcknowledgement(int numberOfMessage, int offset)

findMessagesByHistory

public List findMessagesByHistory(SFRMMessageDVO data, int numberOfMessage, int offset)

Find messages order by descending timestamp by different criteria.

Parameters:
  • data – The message data value object carrying query criteria.
  • numberOfMessage – max no. of message in return.
  • offset – no. of starting record in return.
Throws:

findMessagesByTime

public List findMessagesByTime(int time_period, SFRMMessageDVO data, int numberOfMessage, int offset)

Find the message by the bound of certain time period. The bounded time period is in term of completed timestamp of message

Parameters:
  • time_period – How many month before today
  • data – Criteria to search the message for
  • numberOfMessage – Number of message show in the page
  • offset – Offset of the data in the list of the search result
Returns:

List of SFRMMessageDVO that contain the search result

findNumberOfMessagesByHistory

public int findNumberOfMessagesByHistory(SFRMMessageDVO data)

Find number of the message in the message history by a given search criteria given by dao

Parameters:
  • dao – Search Criteria
Returns:

Number of message found