| 1 |
|
package org.itracker.persistence.dao; |
| 2 |
|
|
| 3 |
|
import java.util.List; |
| 4 |
|
|
| 5 |
|
import org.hibernate.HibernateException; |
| 6 |
|
import org.hibernate.criterion.Expression; |
| 7 |
|
import org.itracker.model.Component; |
| 8 |
|
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 4 |
Complexity Density: 0.67 |
|
| 9 |
|
public class ComponentDAOImpl extends BaseHibernateDAOImpl<Component> |
| 10 |
|
implements ComponentDAO { |
| 11 |
|
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 12 |
0
|
public Component findById(Integer componentId) {... |
| 13 |
0
|
try { |
| 14 |
0
|
return (Component)getSession().get(Component.class, componentId); |
| 15 |
|
} catch (HibernateException e) { |
| 16 |
0
|
throw convertHibernateAccessException(e); |
| 17 |
|
} |
| 18 |
|
} |
| 19 |
|
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 20 |
0
|
@SuppressWarnings("unchecked")... |
| 21 |
|
public List<Component> findByProject(Integer projectId) { |
| 22 |
0
|
try { |
| 23 |
0
|
return getSession().createCriteria(Component.class) |
| 24 |
|
.add(Expression.eq("project.id", projectId)) |
| 25 |
|
.list(); |
| 26 |
|
} catch (HibernateException e) { |
| 27 |
0
|
throw convertHibernateAccessException(e); |
| 28 |
|
} |
| 29 |
|
} |
| 30 |
|
|
| 31 |
|
} |