| 1 |
|
package org.kuali.student.common.test.spring; |
| 2 |
|
|
| 3 |
|
import java.util.List; |
| 4 |
|
import java.util.Map; |
| 5 |
|
import java.util.Map.Entry; |
| 6 |
|
|
| 7 |
|
import javax.persistence.EntityManager; |
| 8 |
|
|
| 9 |
|
import org.springframework.transaction.annotation.Transactional; |
| 10 |
|
|
| 11 |
|
@Transactional |
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
| 12 |
|
public class PersistObjectsBean { |
| 13 |
|
|
| 14 |
|
private Map<EntityManager, List<Object>> objectMap; |
| 15 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 16 |
1
|
public void loadData() {... |
| 17 |
1
|
for (Entry<EntityManager, List<Object>> entry : objectMap.entrySet()) { |
| 18 |
2
|
EntityManager em = entry.getKey(); |
| 19 |
2
|
for (Object o : entry.getValue()) { |
| 20 |
6
|
em.persist(o); |
| 21 |
|
} |
| 22 |
|
} |
| 23 |
|
} |
| 24 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 25 |
1
|
public void setObjectMap(Map<EntityManager, List<Object>> objectMap) {... |
| 26 |
1
|
this.objectMap = objectMap; |
| 27 |
|
} |
| 28 |
|
|
| 29 |
|
} |