View Javadoc
1   /*
2    * Copyright 2005-2009 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.module.purap.service.impl;
17  
18  import org.kuali.ole.module.purap.service.ItemUnitOfMeasureService;
19  import org.kuali.ole.sys.businessobject.UnitOfMeasure;
20  import org.kuali.rice.krad.service.BusinessObjectService;
21  import org.springframework.transaction.annotation.Transactional;
22  
23  /**
24   * This class is the service implementation for the ItemUnitOfMeasureService.
25   * This is the default, Kuali delivered implementation. It's currently used for dwr.
26   */
27  @Transactional
28  public class ItemUnitOfMeasureServiceImpl implements ItemUnitOfMeasureService {
29      protected static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(ItemUnitOfMeasureServiceImpl.class);
30  
31      private BusinessObjectService businessObjectService;
32  
33      /**
34       * @see org.kuali.ole.module.purap.service.ItemUnitOfMeasureService#getByPrimaryId(java.lang.String)
35       */
36      public UnitOfMeasure getByPrimaryId(String itemUnitOfMeasureCode) {
37          UnitOfMeasure toBeRetrieved = new UnitOfMeasure();
38          toBeRetrieved.setItemUnitOfMeasureCode(itemUnitOfMeasureCode.toUpperCase());
39          UnitOfMeasure uom = (UnitOfMeasure) businessObjectService.retrieve(toBeRetrieved);
40          return uom;
41      }
42  
43      public void setBusinessObjectService(BusinessObjectService businessObjectService) {
44          this.businessObjectService = businessObjectService;
45      }
46  
47  }