View Javadoc

1   /**
2    * Copyright 2004-2013 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.core.service;
17  
18  import java.util.ArrayList;
19  import java.util.List;
20  
21  import org.kuali.hr.lm.leaveplan.LeavePlan;
22  import org.kuali.hr.time.task.Task;
23  import org.kuali.hr.time.workarea.WorkArea;
24  import org.kuali.rice.krad.service.impl.ModuleServiceBase;
25  
26  
27  public class KpmeModuleService extends ModuleServiceBase {
28  
29      @Override
30      public List<List<String>> listAlternatePrimaryKeyFieldNames(Class businessObjectInterfaceClass) {
31          if (LeavePlan.class.isAssignableFrom(businessObjectInterfaceClass)) {
32              List<List<String>> retList = new ArrayList<List<String>>();
33              List<String> keyList = new ArrayList<String>();
34              keyList.add("leavePlan");
35              keyList.add("effectiveDate");
36              retList.add(keyList);
37              return retList;
38          } else if (Task.class.isAssignableFrom(businessObjectInterfaceClass)) {
39              List<List<String>> retList = new ArrayList<List<String>>();
40              List<String> keyList = new ArrayList<String>();
41              keyList.add("task");
42              keyList.add("effectiveDate");
43              retList.add(keyList);
44              return retList;
45          } else if (WorkArea.class.isAssignableFrom(businessObjectInterfaceClass)) {
46              List<List<String>> retList = new ArrayList<List<String>>();
47              List<String> keyList = new ArrayList<String>();
48              keyList.add("workArea");
49              keyList.add("effectiveDate");
50              retList.add(keyList);
51              return retList;
52          }
53          return super.listAlternatePrimaryKeyFieldNames(businessObjectInterfaceClass);
54      }
55  }