01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.kuali.module.cg.service.impl;
17:
18: import java.util.HashMap;
19: import java.util.Map;
20:
21: import org.kuali.core.service.BusinessObjectService;
22: import org.kuali.core.util.spring.Cached;
23: import org.kuali.kfs.KFSPropertyConstants;
24: import org.kuali.module.cg.bo.Subcontractor;
25: import org.kuali.module.cg.service.SubcontractorService;
26: import org.springframework.transaction.annotation.Transactional;
27:
28: /**
29: * Implementation of the Subcontractor service.
30: */
31: @Transactional
32: public class SubcontractorServiceImpl implements SubcontractorService {
33:
34: private BusinessObjectService businessObjectService;
35:
36: /**
37: * @see org.kuali.module.cg.service.SubcontractorService#getByPrimaryId(String)
38: */
39: @Cached
40: public Subcontractor getByPrimaryId(String subcontractorNumber) {
41: return (Subcontractor) businessObjectService.findByPrimaryKey(
42: Subcontractor.class,
43: mapPrimaryKeys(subcontractorNumber));
44: }
45:
46: private Map<String, Object> mapPrimaryKeys(
47: String subcontractorNumber) {
48: Map<String, Object> primaryKeys = new HashMap();
49: primaryKeys.put(KFSPropertyConstants.SUBCONTRACTOR_NUMBER,
50: subcontractorNumber.trim());
51: return primaryKeys;
52: }
53:
54: public void setBusinessObjectService(
55: BusinessObjectService businessObjectService) {
56: this.businessObjectService = businessObjectService;
57: }
58: }
|