1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.responsibility.dao.impl;
17
18 import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
19 import org.kuali.rice.core.api.util.RiceConstants;
20 import org.kuali.rice.core.framework.persistence.platform.DatabasePlatform;
21 import org.kuali.rice.kew.responsibility.dao.ResponsibilityIdDAO;
22
23 import javax.persistence.EntityManager;
24 import javax.persistence.PersistenceContext;
25
26 public class ResponsibilityIdDAOJpaImpl implements ResponsibilityIdDAO {
27 @PersistenceContext(unitName = "kew-unit")
28 private EntityManager entityManager;
29
30
31 public String getNewResponsibilityId() {
32 return String.valueOf(getPlatform().getNextValSQL("KREW_RSP_S", entityManager));
33 }
34
35 protected DatabasePlatform getPlatform() {
36 return (DatabasePlatform) GlobalResourceLoader.getService(RiceConstants.DB_PLATFORM);
37 }
38
39 public EntityManager getEntityManager() {
40 return this.entityManager;
41 }
42
43 public void setEntityManager(EntityManager entityManager) {
44 this.entityManager = entityManager;
45 }
46
47 }