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.earncode.EarnCode;
26  import org.kuali.hr.time.earncodegroup.EarnCodeGroup;
27  import org.kuali.hr.time.position.Position;
28  import org.kuali.hr.time.principal.PrincipalHRAttributes;
29  import org.kuali.hr.time.salgroup.SalGroup;
30  import org.kuali.hr.time.task.Task;
31  import org.kuali.hr.time.workarea.WorkArea;
32  import org.kuali.rice.krad.service.impl.ModuleServiceBase;
33  
34  
35  public class KpmeModuleService extends ModuleServiceBase {
36  
37      @Override
38      public List<List<String>> listAlternatePrimaryKeyFieldNames(Class businessObjectInterfaceClass) {
39          if (LeavePlan.class.isAssignableFrom(businessObjectInterfaceClass)) {
40              List<List<String>> retList = new ArrayList<List<String>>();
41              List<String> keyList = new ArrayList<String>();
42              keyList.add("leavePlan");
43              keyList.add("effectiveDate");
44              retList.add(keyList);
45              return retList;
46          } else if (EarnCode.class.isAssignableFrom(businessObjectInterfaceClass)) {
47              List<List<String>> retList = new ArrayList<List<String>>();
48              List<String> keyList = new ArrayList<String>();
49              keyList.add("earnCode");
50              keyList.add("effectiveDate");
51              retList.add(keyList);
52              return retList;
53          } else if (EarnCodeGroup.class.isAssignableFrom(businessObjectInterfaceClass)) {
54              List<List<String>> retList = new ArrayList<List<String>>();
55              List<String> keyList = new ArrayList<String>();
56              keyList.add("earnCodeGroup");
57              keyList.add("effectiveDate");
58              retList.add(keyList);
59              return retList;
60          } else if (Task.class.isAssignableFrom(businessObjectInterfaceClass)) {
61              List<List<String>> retList = new ArrayList<List<String>>();
62              List<String> keyList = new ArrayList<String>();
63              keyList.add("task");
64              keyList.add("effectiveDate");
65              retList.add(keyList);
66              return retList;
67          } else if (WorkArea.class.isAssignableFrom(businessObjectInterfaceClass)) {
68              List<List<String>> retList = new ArrayList<List<String>>();
69              List<String> keyList = new ArrayList<String>();
70              keyList.add("workArea");
71              keyList.add("effectiveDate");
72              retList.add(keyList);
73              return retList;
74          } else if (PayGrade.class.isAssignableFrom(businessObjectInterfaceClass)) {
75              List<List<String>> retList = new ArrayList<List<String>>();
76              List<String> keyList = new ArrayList<String>();
77              keyList.add("payGrade");
78              keyList.add("salGroup");
79              keyList.add("effectiveDate");
80              retList.add(keyList);
81              return retList;
82          } else if (SalGroup.class.isAssignableFrom(businessObjectInterfaceClass)) {
83              List<List<String>> retList = new ArrayList<List<String>>();
84              List<String> keyList = new ArrayList<String>();
85              keyList.add("hrSalGroup");
86              keyList.add("effectiveDate");
87              retList.add(keyList);
88              return retList;
89          } else if (Department.class.isAssignableFrom(businessObjectInterfaceClass)) {
90              List<List<String>> retList = new ArrayList<List<String>>();
91              List<String> keyList = new ArrayList<String>();
92              keyList.add("dept");
93              keyList.add("effectiveDate");
94              retList.add(keyList);
95              return retList;
96          } else if (Position.class.isAssignableFrom(businessObjectInterfaceClass)) {
97              List<List<String>> retList = new ArrayList<List<String>>();
98              List<String> keyList = new ArrayList<String>();
99              keyList.add("positionNumber");
100             keyList.add("effectiveDate");
101             retList.add(keyList);
102             return retList;
103         } else if (AccrualCategory.class.isAssignableFrom(businessObjectInterfaceClass)) {
104             List<List<String>> retList = new ArrayList<List<String>>();
105             List<String> keyList = new ArrayList<String>();
106             keyList.add("accrualCategory");
107             keyList.add("effectiveDate");
108             retList.add(keyList);
109             return retList;
110         } else if (PrincipalHRAttributes.class.isAssignableFrom(businessObjectInterfaceClass)) {
111             List<List<String>> retList = new ArrayList<List<String>>();
112             List<String> keyList = new ArrayList<String>();
113             keyList.add("principalId");
114             keyList.add("effectiveDate");
115             retList.add(keyList);
116             return retList;
117         }
118         return super.listAlternatePrimaryKeyFieldNames(businessObjectInterfaceClass);
119     }
120 }