View Javadoc

1   /**
2    * Copyright 2004-2012 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.hr.time.position.service;
17  
18  import org.kuali.hr.core.cache.CacheUtils;
19  import org.kuali.hr.time.HrBusinessObject;
20  import org.kuali.hr.time.position.Position;
21  import org.kuali.hr.time.service.base.TkServiceLocator;
22  import org.kuali.hr.time.util.HrBusinessObjectMaintainableImpl;
23  import org.kuali.rice.krad.service.KRADServiceLocator;
24  
25  public class PositionMaintainableServiceImpl extends HrBusinessObjectMaintainableImpl {
26  
27      /**
28       *
29       */
30      private static final long serialVersionUID = 1L;
31  
32  
33      @Override
34      public HrBusinessObject getObjectById(String id) {
35          return TkServiceLocator.getPositionService().getPosition(id);
36      }
37  
38      @Override
39      public void saveBusinessObject() {
40          Position position = (Position) this.getBusinessObject();
41          //String nextUniqueNumber = TkServiceLocator.getPositionService().getNextUniquePositionNumber();
42          //position.setPositionNumber(nextUniqueNumber);
43  
44          position = KRADServiceLocator.getBusinessObjectService().save(position);
45          CacheUtils.flushCache(Position.CACHE_NAME);
46      }
47  }