1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.core.service.module;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21 import org.apache.commons.collections.CollectionUtils;
22 import org.kuali.kpme.core.accrualcategory.AccrualCategory;
23 import org.kuali.kpme.core.bo.HrBusinessObject;
24 import org.kuali.kpme.core.cache.CacheUtils;
25 import org.kuali.kpme.core.calendar.Calendar;
26 import org.kuali.kpme.core.department.Department;
27 import org.kuali.kpme.core.earncode.EarnCode;
28 import org.kuali.kpme.core.earncode.group.EarnCodeGroup;
29 import org.kuali.kpme.core.institution.Institution;
30 import org.kuali.kpme.core.job.Job;
31 import org.kuali.kpme.core.leaveplan.LeavePlan;
32 import org.kuali.kpme.core.location.Location;
33 import org.kuali.kpme.core.paygrade.PayGrade;
34 import org.kuali.kpme.core.paytype.PayType;
35 import org.kuali.kpme.core.position.PositionBase;
36 import org.kuali.kpme.core.principal.PrincipalHRAttributes;
37 import org.kuali.kpme.core.salarygroup.SalaryGroup;
38 import org.kuali.kpme.core.task.Task;
39 import org.kuali.kpme.core.util.HrConstants;
40 import org.kuali.kpme.core.workarea.WorkArea;
41 import org.kuali.rice.krad.service.impl.ModuleServiceBase;
42
43
44 public class KpmeModuleService extends ModuleServiceBase {
45
46 @Override
47 public List<List<String>> listAlternatePrimaryKeyFieldNames(Class businessObjectInterfaceClass) {
48 List<List<String>> retList = new ArrayList<List<String>>();
49 List<String> keyList = new ArrayList<String>();
50 try {
51 keyList.addAll((java.util.List<String>) businessObjectInterfaceClass.getDeclaredField("EQUAL_TO_FIELDS").get(businessObjectInterfaceClass));
52 } catch (NoSuchFieldException e) {
53 LOG.warn(businessObjectInterfaceClass.getClass().getName() + " does not contain a EQUAL_TO_FIELDS list");
54 } catch (IllegalAccessException e) {
55 LOG.warn(businessObjectInterfaceClass.getClass().getName() + " does not contain a EQUAL_TO_FIELDS list");
56 }
57
58 if (HrBusinessObject.class.isAssignableFrom(businessObjectInterfaceClass)) {
59 keyList.add(HrConstants.EFFECTIVE_DATE_FIELD);
60 }
61 if (CollectionUtils.isNotEmpty(keyList)) {
62 retList.add(keyList);
63 return retList;
64 }
65 return super.listAlternatePrimaryKeyFieldNames(businessObjectInterfaceClass);
66 }
67 }