| 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.Notification; |
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
|
|
|
| 0% |
Uncovered Elements: 15 (15) |
Complexity: 5 |
Complexity Density: 0.42 |
|
| 12 |
|
public class NotificationDAOImpl |
| 13 |
|
extends BaseHibernateDAOImpl<Notification> |
| 14 |
|
implements NotificationDAO { |
| 15 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 16 |
0
|
public NotificationDAOImpl() {... |
| 17 |
|
} |
| 18 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.4 |
|
| 19 |
0
|
public Notification findById(Integer id) {... |
| 20 |
0
|
Notification notification; |
| 21 |
|
|
| 22 |
0
|
try { |
| 23 |
0
|
notification = (Notification)getSession().get(Notification.class, id); |
| 24 |
|
} catch (HibernateException ex) { |
| 25 |
0
|
throw convertHibernateAccessException(ex); |
| 26 |
|
} |
| 27 |
0
|
return notification; |
| 28 |
|
} |
| 29 |
|
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.29 |
|
| 30 |
0
|
@SuppressWarnings("unchecked")... |
| 31 |
|
public List<Notification> findByIssueId(Integer issueId) { |
| 32 |
0
|
List<Notification> notifications; |
| 33 |
|
|
| 34 |
0
|
try { |
| 35 |
0
|
Query query = getSession().getNamedQuery( |
| 36 |
|
"NotificationsByIssueQuery"); |
| 37 |
0
|
query.setInteger("issueId", issueId); |
| 38 |
0
|
notifications = query.list(); |
| 39 |
|
} catch (HibernateException ex) { |
| 40 |
0
|
throw convertHibernateAccessException(ex); |
| 41 |
|
} |
| 42 |
0
|
return notifications; |
| 43 |
|
} |
| 44 |
|
|
| 45 |
|
} |