Clover Coverage Report - KS LUM 1.1.1-SNAPSHOT (Aggregated)
Coverage timestamp: Wed Apr 20 2011 05:50:45 EST
../../../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
16   69   6   4
0   47   0.38   4
4     1.5  
1    
 
  LrcDaoImpl       Line # 31 16 0% 6 1 95% 0.95
 
  (26)
 
1    /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10    * software distributed under the License is distributed on an "AS IS"
11    * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12    * or implied. See the License for the specific language governing
13    * permissions and limitations under the License.
14    */
15   
16    package org.kuali.student.lum.lrc.dao.impl;
17   
18    import java.util.List;
19   
20    import javax.persistence.EntityManager;
21    import javax.persistence.EntityNotFoundException;
22    import javax.persistence.NoResultException;
23    import javax.persistence.PersistenceContext;
24    import javax.persistence.Query;
25   
26    import org.kuali.student.core.dao.impl.AbstractSearchableCrudDaoImpl;
27    import org.kuali.student.core.exceptions.DoesNotExistException;
28    import org.kuali.student.lum.lrc.dao.LrcDao;
29    import org.kuali.student.lum.lrc.entity.ResultComponentType;
30   
 
31    public class LrcDaoImpl extends AbstractSearchableCrudDaoImpl implements LrcDao {
 
32  8 toggle @PersistenceContext(unitName = "Lrc")
33    @Override
34    public void setEm(EntityManager em) {
35  8 super.setEm(em);
36    }
37   
 
38  3 toggle @Override
39    public List<String> getResultComponentIdsByResult(String resultValueId, String resultComponentTypeKey) {
40  3 Query query = em.createNamedQuery("ResultComponent.getResultComponentIdsByResult");
41  3 query.setParameter("resultValueId", resultValueId);
42  3 query.setParameter("resultComponentTypeKey", resultComponentTypeKey);
43  3 @SuppressWarnings("unchecked")
44    List<String> resultList = query.getResultList();
45  3 return resultList;
46    }
47   
 
48  119 toggle @Override
49    public List<String> getResultComponentIdsByResultComponentType(String resultComponentTypeKey) {
50  119 Query query = em.createNamedQuery("ResultComponent.getResultComponentIdsByResultComponentType");
51  119 query.setParameter("resultComponentTypeKey", resultComponentTypeKey);
52  119 @SuppressWarnings("unchecked")
53    List<String> resultList = query.getResultList();
54  119 return resultList;
55    }
56   
 
57  2 toggle @Override
58    public ResultComponentType getResultComponentType(String resultComponentTypeKey) throws DoesNotExistException {
59  2 Query query = em.createNamedQuery("ResultComponent.getResultComponentType");
60  2 query.setParameter("resultComponentTypeKey", resultComponentTypeKey);
61  2 try {
62  2 return (ResultComponentType)query.getSingleResult();
63    } catch (NoResultException e) {
64  1 throw new DoesNotExistException();
65    } catch (EntityNotFoundException e){
66  0 throw new DoesNotExistException();
67    }
68    }
69    }