01: /*
02: * Copyright 2006-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.financial.service.impl;
17:
18: import java.util.Collection;
19: import java.util.HashMap;
20:
21: import org.kuali.core.service.BusinessObjectService;
22: import org.kuali.kfs.KFSPropertyConstants;
23: import org.kuali.module.financial.bo.ServiceBillingControl;
24: import org.kuali.module.financial.service.ServiceBillingControlService;
25: import org.springframework.transaction.annotation.Transactional;
26:
27: /**
28: * This is the default implementation of the ServiceBillingControlService interface.
29: */
30: @Transactional
31: public class ServiceBillingControlServiceImpl implements
32: ServiceBillingControlService {
33:
34: private BusinessObjectService businessObjectService;
35:
36: /**
37: * This method retrieves a ServiceBillingControl object using the values provided.
38: *
39: * @param chartOfAccountsCode The chart code used to retrieve the service billing control.
40: * @param accountNumber The account number used to retrieve the service billing control.
41: * @return An instance of a ServiceBillingControl which matches the parameters provided.
42: *
43: * @see ServiceBillingControlService#getByPrimaryId(String, String)
44: */
45: public ServiceBillingControl getByPrimaryId(
46: String chartOfAccountsCode, String accountNumber) {
47: HashMap keys = new HashMap();
48: keys.put(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE,
49: chartOfAccountsCode);
50: keys.put(KFSPropertyConstants.ACCOUNT_NUMBER, accountNumber);
51: return (ServiceBillingControl) businessObjectService
52: .findByPrimaryKey(ServiceBillingControl.class, keys);
53: }
54:
55: /**
56: * This method retrieves all ServiceBillingControl objects in the database.
57: *
58: * @return A collection of all ServiceBillingControls defined in the database.
59: *
60: * @see ServiceBillingControlService#getAll()
61: */
62: public ServiceBillingControl[] getAll() {
63: Collection<ServiceBillingControl> controls = businessObjectService
64: .findAll(ServiceBillingControl.class);
65: return (ServiceBillingControl[]) controls
66: .toArray(new ServiceBillingControl[0]);
67: }
68:
69: /**
70: * Gets the businessObjectService attribute.
71: * @return The value of the businessObjectService attribute.
72: */
73: public BusinessObjectService getBusinessObjectService() {
74: return businessObjectService;
75: }
76:
77: /**
78: * Sets the businessObjectService attribute value.
79: * @param businessObjectService The businessObjectService to set.
80: */
81: public void setBusinessObjectService(
82: BusinessObjectService businessObjectService) {
83: this.businessObjectService = businessObjectService;
84: }
85: }
|