Class AttachmentDao


public class AttachmentDao extends AbstractDao
Provides a DAO for the Attachment entity.
See Also:
  • Constructor Details

    • AttachmentDao

      public AttachmentDao()
  • Method Details

    • getAttachmentForIdAndSubmission

      public Attachment getAttachmentForIdAndSubmission(Long id)
      Return the attachment for the given attachment id.
      Parameters:
      id - the attachment id (required)
      Returns:
      the attachment for the given attachment id
      Since:
      5.0
    • getAttachmentForIdAndSubmission

      public Attachment getAttachmentForIdAndSubmission(Long id, Submission submission)
      Return the attachment for the given submission and attachment id.
      Parameters:
      id - the attachment id
      submission - the attachment submission
      Returns:
      the attachment for the given submission and attachment id
      Since:
      5.0
    • getAttachmentsForSubmissionKey

      public List getAttachmentsForSubmissionKey(String submissionId, boolean deliverSubmittedPDF)
      Return attachment information for a given submission
      Parameters:
      submissionId - a valid submission OID
      deliverSubmittedPDF - whether the submitted PDF form shall be delivered
      Returns:
      a list of DataRow objects containing attachment information
    • getAttachmentForAttachmentKey

      public Attachment getAttachmentForAttachmentKey(String clientKey, String attachmentKey)
      Return the attachment for a specific attachment surrogate key and client
      Parameters:
      clientKey - the surrogate key of the client associated with the submission
      attachmentKey - the surrogate key of the attachment
      Returns:
      the attachment for the given client and attachment surrogate keys
    • getAttachmentForAttachmentKey

      public Attachment getAttachmentForAttachmentKey(String attachmentKey)
      Return the attachment for a specific attachment surrogate key
      Parameters:
      attachmentKey - the surrogate key of the attachment
      Returns:
      the attachment for the given surrogate key
    • getSubmissionFileAttachments

      public List<Attachment> getSubmissionFileAttachments(Submission submission)
      Return all attachments for a submission, also pre-fetching the associated file upload objects
      Parameters:
      submission - the submission
      Returns:
      the list of attachments for the submission
    • getSubmissionElectronicAttachments

      public List<Map<String,Object>> getSubmissionElectronicAttachments(Long submissionId)
      Return the data of all the electronic attachments associated with the given submission.
      Parameters:
      submissionId - a valid submission OID
      Returns:
      a list of DataRow objects containing attachment information
    • getSubmissionElectronicAttachmentsSummary

      public List<Map<String,Object>> getSubmissionElectronicAttachmentsSummary(Long submissionId)
      Return summary of all the electronic attachments associated with the given submission.
      Parameters:
      submissionId - a valid submission OID
      Returns:
      a row of data containing attachment information summary