1 /*
2 * Copyright 2007 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
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.ole.sys.service.impl;
17
18 import org.kuali.ole.sys.businessobject.HomeOrigination;
19 import org.kuali.ole.sys.service.HomeOriginationService;
20 import org.kuali.rice.krad.service.BusinessObjectService;
21 import org.springframework.cache.annotation.Cacheable;
22
23 public class HomeOriginationServiceImpl implements HomeOriginationService {
24 protected BusinessObjectService businessObjectService;
25
26 /**
27 * Retrieves a HomeOrigination object. Currently, there is only a single, unique HomeOriginationCode record in the database.
28 */
29 @Override
30 @Cacheable(value=HomeOrigination.CACHE_NAME, key="'{getHomeOrigination}'")
31 public HomeOrigination getHomeOrigination() {
32 // no, I'm not doing null checking - if this is missing, we have other problems
33 return businessObjectService.findAll(HomeOrigination.class).iterator().next();
34 }
35
36
37 public void setBusinessObjectService(BusinessObjectService businessObjectService) {
38 this.businessObjectService = businessObjectService;
39 }
40
41 }