1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.time.roles.dao;
17
18 import java.util.List;
19
20 import org.apache.ojb.broker.query.Criteria;
21 import org.apache.ojb.broker.query.QueryFactory;
22 import org.kuali.hr.time.roles.TkRoleGroup;
23 import org.kuali.rice.core.framework.persistence.ojb.dao.PlatformAwareDaoBaseOjb;
24
25 public class TkRoleGroupDaoSpringOjbImpl extends PlatformAwareDaoBaseOjb implements TkRoleGroupDao {
26
27 @Override
28 public void saveOrUpdateRoleGroup(TkRoleGroup roleGroup) {
29 this.getPersistenceBrokerTemplate().store(roleGroup);
30 }
31
32 @Override
33 public void saveOrUpdateRoleGroups(List<TkRoleGroup> roleGroups) {
34 if (roleGroups != null) {
35 for (TkRoleGroup role : roleGroups) {
36 saveOrUpdateRoleGroup(role);
37 }
38 }
39 }
40
41 @Override
42 public TkRoleGroup getRoleGroup(String principalId) {
43 Criteria currentRecordCriteria = new Criteria();
44 currentRecordCriteria.addEqualTo("principalId", principalId);
45
46 return (TkRoleGroup) this.getPersistenceBrokerTemplate().getObjectByQuery(QueryFactory.newQuery(TkRoleGroup.class, currentRecordCriteria));
47 }
48
49
50 }