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