1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.module.cg.service.impl;
17
18 import java.util.HashMap;
19 import java.util.Map;
20
21 import org.kuali.ole.module.cg.businessobject.Agency;
22 import org.kuali.ole.module.cg.service.AgencyService;
23 import org.kuali.ole.sys.OLEPropertyConstants;
24 import org.kuali.rice.krad.service.BusinessObjectService;
25 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
26
27
28
29
30 public class AgencyServiceImpl implements AgencyService {
31
32 protected BusinessObjectService businessObjectService;
33
34
35
36
37 @Override
38 public Agency getByPrimaryId(String agencyNumber) {
39 return KRADServiceLocatorWeb.getLegacyDataAdapter().findByPrimaryKey(Agency.class, mapPrimaryKeys(agencyNumber));
40 }
41
42 protected Map<String, Object> mapPrimaryKeys(String agencyNumber) {
43 Map<String, Object> primaryKeys = new HashMap();
44 primaryKeys.put(OLEPropertyConstants.AGENCY_NUMBER, agencyNumber.trim());
45 return primaryKeys;
46 }
47
48 public void setBusinessObjectService(BusinessObjectService businessObjectService) {
49 this.businessObjectService = businessObjectService;
50 }
51 }