Clover Coverage Report - itracker
Coverage timestamp: Tue May 1 2012 16:42:12 CEST
37   97   13   6.17
2   78   0.35   6
6     2.17  
1    
 
 
  IssueAttachmentDAOImpl       Line # 14 37 13 0% 0.0
 
No Tests
 
1    package org.itracker.persistence.dao;
2   
3    import java.util.List;
4   
5    import org.hibernate.HibernateException;
6    import org.hibernate.Query;
7    import org.itracker.model.IssueAttachment;
8   
9    /**
10    * Persistence Hibernate POJO
11    *
12    * @author mbae, ready
13    */
 
14    public class IssueAttachmentDAOImpl extends BaseHibernateDAOImpl<IssueAttachment>
15    implements IssueAttachmentDAO {
16   
 
17  0 toggle public IssueAttachment findByPrimaryKey(Integer attachmentId) {
18  0 try {
19  0 return (IssueAttachment)getSession().get(IssueAttachment.class,
20    attachmentId);
21    } catch (HibernateException ex) {
22  0 throw convertHibernateAccessException(ex);
23    }
24    }
25   
 
26  0 toggle public IssueAttachment findByFileName(String fileName) {
27  0 IssueAttachment attachment;
28   
29  0 try {
30  0 Query query = getSession().getNamedQuery(
31    "AttachmentByFileNameQuery");
32  0 query.setString("fileName", fileName);
33  0 attachment = (IssueAttachment)query.uniqueResult();
34    } catch (HibernateException ex) {
35  0 throw convertHibernateAccessException(ex);
36    }
37  0 return attachment;
38    }
39   
 
40  0 toggle @SuppressWarnings("unchecked")
41    public List<IssueAttachment> findAll() {
42  0 List<IssueAttachment> attachments;
43   
44  0 try {
45  0 Query query = getSession().getNamedQuery(
46    "AttachmentsAllQuery");
47  0 attachments = query.list();
48    } catch (HibernateException ex) {
49  0 throw convertHibernateAccessException(ex);
50    }
51  0 return attachments;
52    }
53   
 
54  0 toggle @SuppressWarnings("unchecked")
55    public List<IssueAttachment> findByIssue(Integer issueId) {
56  0 List<IssueAttachment> attachments;
57   
58  0 try {
59  0 Query query = getSession().getNamedQuery(
60    "AttachmentsByIssueQuery");
61  0 query.setInteger("issueId", issueId);
62  0 attachments = query.list();
63    } catch (HibernateException ex) {
64  0 throw convertHibernateAccessException(ex);
65    }
66  0 return attachments;
67    }
68   
 
69  0 toggle public Long countAll() {
70  0 Long count;
71  0 try {
72  0 Query query = getSession().getNamedQuery(
73    "AttachmentsCountAllQuery");
74  0 count = (Long)query.uniqueResult();
75    } catch (HibernateException ex) {
76  0 throw convertHibernateAccessException(ex);
77    }
78  0 return count;
79    }
80   
 
81  0 toggle public Long totalAttachmentsSize() {
82  0 Long count;
83  0 try {
84  0 Query query = getSession().getNamedQuery(
85    "TotalAttachmentsSizeQuery");
86  0 count = (Long)query.uniqueResult();
87    } catch (HibernateException ex) {
88  0 throw convertHibernateAccessException(ex);
89    }
90   
91  0 if( count == null ) {
92  0 count = 0L;
93    }
94   
95  0 return count;
96    }
97    }