1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kew.removereplace.dao.impl; |
17 | |
|
18 | |
import javax.persistence.EntityManager; |
19 | |
import javax.persistence.PersistenceContext; |
20 | |
import javax.persistence.Query; |
21 | |
|
22 | |
import org.kuali.rice.kew.removereplace.RemoveReplaceDocument; |
23 | |
import org.kuali.rice.kew.removereplace.dao.RemoveReplaceDocumentDAO; |
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | 0 | public class RemoveReplaceDocumentDAOJpaImpl implements RemoveReplaceDocumentDAO { |
33 | |
|
34 | |
@PersistenceContext(unitName="kew-unit") |
35 | |
EntityManager entityManager; |
36 | |
|
37 | |
public void save(RemoveReplaceDocument document) { |
38 | 0 | entityManager.persist(document); |
39 | 0 | } |
40 | |
|
41 | |
public RemoveReplaceDocument findById(Long documentId) { |
42 | 0 | Query query = entityManager.createNamedQuery("RemoveReplaceDocument.FindByDocumentId"); |
43 | 0 | query.setParameter("documentId", documentId); |
44 | 0 | return (RemoveReplaceDocument)query.getSingleResult(); |
45 | |
} |
46 | |
|
47 | |
public EntityManager getEntityManager() { |
48 | 0 | return this.entityManager; |
49 | |
} |
50 | |
|
51 | |
public void setEntityManager(EntityManager entityManager) { |
52 | 0 | this.entityManager = entityManager; |
53 | 0 | } |
54 | |
|
55 | |
} |