public int findNumOfMessagesByMessageBoxAndCpaAndSequenceGroup(MessageDVO data) throws DAOException { try { List result = super.executeRawQuery( super.getFinder("find_num_of_messages_by_message_box_and_cpa_and_sequence_group"), new Object[] { data.getMessageBox(), data.getCpaId(), data.getService(), data.getAction(), data.getConvId(), new Integer(data.getSequenceGroup()) }); List resultEntry = (List) result.get(0); return ((Number) resultEntry.get(0)).intValue(); } catch (Exception e) { throw new DAOException("Unable to find the number of messages by history", e); } }
public boolean findOrderedMessageByMessageBoxAndCpaAndSequenceGroupAndSequenceNo(MessageDVO data) throws DAOException { List l = super.find( "find_ordered_message_by_message_box_and_cpa_and_sequence_group_and_sequence_no", new Object[] { data.getMessageBox(), data.getCpaId(), data.getService(), data.getAction(), data.getConvId(), new Integer(data.getSequenceGroup()), new Integer(data.getSequenceNo()) }); Iterator i = l.iterator(); if (i.hasNext()) { ((MessageDataSourceDVO) data).setData(((MessageDataSourceDVO) i.next()).getData()); return true; } return false; }