1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.notes.dao.impl;
17
18 import org.kuali.rice.kew.notes.dao.NoteDAO;
19
20 import javax.persistence.EntityManager;
21 import javax.persistence.Query;
22 import java.util.List;
23
24 public class NoteDAOJpa implements NoteDAO {
25
26 EntityManager entityManager;
27
28 public List getNotesByDocumentId(String documentId) {
29 Query query = entityManager.createNamedQuery("KewNote.FindNoteByDocumentId");
30 query.setParameter("documentId", documentId);
31 return (List) query.getResultList();
32 }
33
34 public EntityManager getEntityManager() {
35 return this.entityManager;
36 }
37
38 public void setEntityManager(EntityManager entityManager) {
39 this.entityManager = entityManager;
40 }
41
42 }