@Test public void testFindMessageForAcknowledgement() throws DAOException{ SFRMMessageDSDAO dao = super.getTestingTarget(); List results = dao.findMessageForAcknowledgement(10, 0); ArrayList msgs = new ArrayList(); for(int i=0; results.size() > i; i++){ msgs.add(((SFRMMessageDVO) results.get(i)).getMessageId()); } assertMessageinList(results, "A", true); assertMessageinList(results, "B", true); assertMessageinList(results, "C", true); assertMessageinList(results, "D", true); assertMessageinList(results, "E", true); assertMessageinList(results, "F", false); }
public List findMessageForAcknowledgement(int numberOfMessage, int offset) throws DAOException{ try{ List messagesDVO = new ArrayList(); List parameters = new ArrayList(); String sql = getFinder("find_message_for_acknowledgement"); String order = getOrder("find_message_for_acknowledgement_order"); sql = sql + " " + order; parameters.add(new Integer(numberOfMessage)); parameters.add(new Integer(offset)); List queryResult = executeQuery(sql, parameters.toArray()); return queryResult; }catch(Exception e){ e.printStackTrace(); throw new DAOException("Unable to find the message that is ready for requesting acknowledgement"); } }
SFRMMessageDSDAO extends DataSourceDAO implements SFRMMessageDAO { public List findMessageForAcknowledgement(int numberOfMessage, int offset) throws DAOException{ try{ List messagesDVO = new ArrayList(); List parameters = new ArrayList(); String sql = getFinder("find_message_for_acknowledgement"); String order = getOrder("find_message_for_acknowledgement_order"); sql = sql + " " + order; parameters.add(new Integer(numberOfMessage)); parameters.add(new Integer(offset)); List queryResult = executeQuery(sql, parameters.toArray()); return queryResult; }catch(Exception e){ e.printStackTrace(); throw new DAOException("Unable to find the message that is ready for requesting acknowledgement"); } } }
SFRMMessageDSDAO extends DataSourceDAO implements SFRMMessageDAO { public List findMessageForAcknowledgement(int numberOfMessage, int offset) throws DAOException{ try{ List messagesDVO = new ArrayList(); List parameters = new ArrayList(); String sql = getFinder("find_message_for_acknowledgement"); String order = getOrder("find_message_for_acknowledgement_order"); sql = sql + " " + order; parameters.add(new Integer(numberOfMessage)); parameters.add(new Integer(offset)); List queryResult = executeQuery(sql, parameters.toArray()); return queryResult; }catch(Exception e){ e.printStackTrace(); throw new DAOException("Unable to find the message that is ready for requesting acknowledgement"); } }  }
SFRMMessageDSDAO extends DataSourceDAO implements SFRMMessageDAO { public List findMessageForAcknowledgement(int numberOfMessage, int offset) throws DAOException{ try{ List messagesDVO = new ArrayList(); List parameters = new ArrayList(); String sql = getFinder("find_message_for_acknowledgement"); String order = getOrder("find_message_for_acknowledgement_order"); sql = sql + " " + order; parameters.add(new Integer(numberOfMessage)); parameters.add(new Integer(offset)); List queryResult = executeQuery(sql, parameters.toArray()); return queryResult; }catch(Exception e){ e.printStackTrace(); throw new DAOException("Unable to find the message that is ready for requesting acknowledgement"); } }  DVO createDVO(); SFRMMessageDVO findMessageByMessageIdAndBox(
			String messageId,
			String messageBox); SFRMMessageDVO findMessageByMessageIdAndBox(
			SFRMMessageDVO message); List findMessageByMessageBoxAndStatus(
			String messageBox,
			String status); List findMessageByMessageBoxAndPartnershipIdAndStatus(
			String messageBox,
			String partnershipId,
			String status); int findNumberOfMessagesByHistory(SFRMMessageDVO data); List findMessagesByHistory(SFRMMessageDVO data, int numberOfMessage, int offset); List findMessagesByTime(int time_period, SFRMMessageDVO data, int numberOfMessage, int offset); List findMessageForAcknowledgement(int numberOfMessage, int offset); }
SFRMMessageDSDAO extends DataSourceDAO implements SFRMMessageDAO { public List findMessageForAcknowledgement(int numberOfMessage, int offset) throws DAOException{ try{ List messagesDVO = new ArrayList(); List parameters = new ArrayList(); String sql = getFinder("find_message_for_acknowledgement"); String order = getOrder("find_message_for_acknowledgement_order"); sql = sql + " " + order; parameters.add(new Integer(numberOfMessage)); parameters.add(new Integer(offset)); List queryResult = executeQuery(sql, parameters.toArray()); return queryResult; }catch(Exception e){ e.printStackTrace(); throw new DAOException("Unable to find the message that is ready for requesting acknowledgement"); } }  DVO createDVO(); SFRMMessageDVO findMessageByMessageIdAndBox(
			String messageId,
			String messageBox); SFRMMessageDVO findMessageByMessageIdAndBox(
			SFRMMessageDVO message); List findMessageByMessageBoxAndStatus(
			String messageBox,
			String status); List findMessageByMessageBoxAndPartnershipIdAndStatus(
			String messageBox,
			String partnershipId,
			String status); int findNumberOfMessagesByHistory(SFRMMessageDVO data); List findMessagesByHistory(SFRMMessageDVO data, int numberOfMessage, int offset); List findMessagesByTime(int time_period, SFRMMessageDVO data, int numberOfMessage, int offset); List findMessageForAcknowledgement(int numberOfMessage, int offset);  }