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.accrual.AccrualCategory;
22  import org.kuali.hr.lm.leaveplan.LeavePlan;
23  import org.kuali.hr.paygrade.PayGrade;
24  import org.kuali.hr.time.department.Department;
25  import org.kuali.hr.time.position.Position;
26  import org.kuali.hr.time.salgroup.SalGroup;
27  import org.kuali.hr.time.task.Task;
28  import org.kuali.hr.time.workarea.WorkArea;
29  import org.kuali.rice.krad.service.impl.ModuleServiceBase;
30  
31  
32  public class KpmeModuleService extends ModuleServiceBase {
33  
34      @Override
35      public List<List<String>> listAlternatePrimaryKeyFieldNames(Class businessObjectInterfaceClass) {
36          if (LeavePlan.class.isAssignableFrom(businessObjectInterfaceClass)) {
37              List<List<String>> retList = new ArrayList<List<String>>();
38              List<String> keyList = new ArrayList<String>();
39              keyList.add("leavePlan");
40              keyList.add("effectiveDate");
41              retList.add(keyList);
42              return retList;
43          } else if (Task.class.isAssignableFrom(businessObjectInterfaceClass)) {
44              List<List<String>> retList = new ArrayList<List<String>>();
45              List<String> keyList = new ArrayList<String>();
46              keyList.add("task");
47              keyList.add("effectiveDate");
48              retList.add(keyList);
49              return retList;
50          } else if (WorkArea.class.isAssignableFrom(businessObjectInterfaceClass)) {
51              List<List<String>> retList = new ArrayList<List<String>>();
52              List<String> keyList = new ArrayList<String>();
53              keyList.add("workArea");
54              keyList.add("effectiveDate");
55              retList.add(keyList);
56              return retList;
57          } else if (PayGrade.class.isAssignableFrom(businessObjectInterfaceClass)) {
58              List<List<String>> retList = new ArrayList<List<String>>();
59              List<String> keyList = new ArrayList<String>();
60              keyList.add("payGrade");
61              keyList.add("salGroup");
62              keyList.add("effectiveDate");
63              retList.add(keyList);
64              return retList;
65          } else if (SalGroup.class.isAssignableFrom(businessObjectInterfaceClass)) {
66              List<List<String>> retList = new ArrayList<List<String>>();
67              List<String> keyList = new ArrayList<String>();
68              keyList.add("hrSalGroup");
69              keyList.add("effectiveDate");
70              retList.add(keyList);
71              return retList;
72          } else if (Department.class.isAssignableFrom(businessObjectInterfaceClass)) {
73              List<List<String>> retList = new ArrayList<List<String>>();
74              List<String> keyList = new ArrayList<String>();
75              keyList.add("dept");
76              keyList.add("effectiveDate");
77              retList.add(keyList);
78              return retList;
79          } else if (Position.class.isAssignableFrom(businessObjectInterfaceClass)) {
80              List<List<String>> retList = new ArrayList<List<String>>();
81              List<String> keyList = new ArrayList<String>();
82              keyList.add("positionNumber");
83              keyList.add("effectiveDate");
84              retList.add(keyList);
85              return retList;
86          } else if (AccrualCategory.class.isAssignableFrom(businessObjectInterfaceClass)) {
87              List<List<String>> retList = new ArrayList<List<String>>();
88              List<String> keyList = new ArrayList<String>();
89              keyList.add("accrualCategory");
90              keyList.add("effectiveDate");
91              retList.add(keyList);
92              return retList;
93          }
94          return super.listAlternatePrimaryKeyFieldNames(businessObjectInterfaceClass);
95      }
96  }