1 package org.itracker.persistence.dao;
2
3 import org.itracker.model.IssueAttachment;
4
5 import java.util.List;
6
7 /**
8 *
9 */
10 public interface IssueAttachmentDAO extends BaseDAO<IssueAttachment> {
11
12 /**
13 * @param attachmentId system ID
14 * @return attachment instance or <tt>null</tt> if none exists
15 */
16 IssueAttachment findByPrimaryKey(Integer attachmentId);
17
18 /**
19 * Finds an attachment by the file name on the filesystem.
20 *
21 * @return attachment instance or <tt>null</tt> if none exists
22 */
23 IssueAttachment findByFileName(String fileName);
24
25 /**
26 * Finds all Issue attachments.
27 *
28 * @return list of all issue attachments, in unspecified order
29 */
30 List<IssueAttachment> findAll();
31
32 /**
33 * Counts all Issue attachments.
34 *
35 * @return count of all issue attachments in system
36 */
37
38 Long countAll();
39
40 /**
41 * Calculates the total Size of attachments in the system.
42 *
43 * @return total size of issue attachments
44 */
45 Long totalAttachmentsSize();
46
47 /**
48 * Finds all attachments for an Issue.
49 *
50 * @param issueId system ID
51 * @return list of all issue attachments, in unspecified order
52 */
53 List<IssueAttachment> findByIssue(Integer issueId);
54
55 }