1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.kuali.rice.ksb.messaging.bam.dao.impl; |
17 |
|
|
18 |
|
import java.util.List; |
19 |
|
|
20 |
|
import javax.persistence.EntityManager; |
21 |
|
import javax.persistence.PersistenceContext; |
22 |
|
import javax.xml.namespace.QName; |
23 |
|
|
24 |
|
import org.kuali.rice.core.api.reflect.ObjectDefinition; |
25 |
|
import org.kuali.rice.core.api.reflect.ObjectDefinition; |
26 |
|
import org.kuali.rice.ksb.messaging.bam.BAMTargetEntry; |
27 |
|
import org.kuali.rice.ksb.messaging.bam.dao.BAMDAO; |
28 |
|
|
29 |
|
|
|
|
| 0% |
Uncovered Elements: 21 (21) |
Complexity: 8 |
Complexity Density: 0.67 |
|
30 |
|
public class BAMDaoJpaImpl implements BAMDAO { |
31 |
|
|
32 |
|
private EntityManager entityManager; |
33 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
34 |
0
|
@PersistenceContext... |
35 |
|
public void setEntityManager(EntityManager entityManager) { |
36 |
0
|
this.entityManager = entityManager; |
37 |
|
} |
38 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
39 |
0
|
public void clearBAMTables() {... |
40 |
0
|
entityManager.createQuery("delete from BAMTargetEntry").executeUpdate(); |
41 |
0
|
entityManager.createQuery("delete from BAMParam").executeUpdate(); |
42 |
|
} |
43 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
44 |
0
|
public List<BAMTargetEntry> getCallsForService(QName serviceName, String methodName) { ... |
45 |
0
|
return (List<BAMTargetEntry>) entityManager.createQuery("select bte from BAMTargetEntry bte where bte.serviceName = :serviceName and bte.methodName = :methodName").setParameter("serviceName", serviceName.toString()).setParameter("methodName", methodName).getResultList(); |
46 |
|
} |
47 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
48 |
0
|
public void save(BAMTargetEntry bamEntry) {... |
49 |
0
|
if(bamEntry.getBamId() == null) { |
50 |
0
|
entityManager.persist(bamEntry); |
51 |
|
} |
52 |
|
else { |
53 |
0
|
entityManager.merge(bamEntry); |
54 |
|
} |
55 |
|
} |
56 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
57 |
0
|
public List<BAMTargetEntry> getCallsForService(QName serviceName) {... |
58 |
0
|
return (List<BAMTargetEntry>) entityManager.createQuery("select bte from BAMTargetEntry bte where bte.serviceName = :serviceName").setParameter("serviceName", serviceName.toString()).getResultList(); |
59 |
|
} |
60 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
61 |
0
|
public List<BAMTargetEntry> getCallsForRemotedClasses(ObjectDefinition objDef) {... |
62 |
0
|
QName qname = new QName(objDef.getServiceNamespace(), objDef.getClassName()); |
63 |
0
|
return (List<BAMTargetEntry>) entityManager.createQuery("select bte from BAMTargetEntry bte where bte.serviceName like :serviceName%").setParameter("serviceName", qname.toString()).getResultList(); |
64 |
|
} |
65 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
66 |
0
|
public List<BAMTargetEntry> getCallsForRemotedClasses(ObjectDefinition objDef, String methodName) {... |
67 |
0
|
QName qname = new QName(objDef.getServiceNamespace(), objDef.getClassName()); |
68 |
0
|
return (List<BAMTargetEntry>) entityManager.createQuery("select bte from BAMTargetEntry bte where bte.serviceName like :serviceName% and bte.methodName = :methodName").setParameter("serviceName", qname.toString()).setParameter("methodName", methodName).getResultList(); |
69 |
|
} |
70 |
|
|
71 |
|
} |