1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kns.lookup;
17
18 import java.util.Collection;
19 import java.util.HashMap;
20 import java.util.Map;
21 import java.util.Set;
22
23 import org.kuali.rice.krad.bo.BusinessObject;
24 import org.kuali.rice.krad.bo.PersistableBusinessObject;
25 import org.kuali.rice.krad.service.BusinessObjectService;
26 import org.kuali.rice.krad.util.KRADPropertyConstants;
27
28
29
30
31
32
33
34
35 @Deprecated
36 public class PersistableBusinessObjectLookupResultsSupportStrategyImpl
37 implements LookupResultsSupportStrategyService {
38
39 private BusinessObjectService businessObjectService;
40
41
42
43
44
45
46 public String getLookupIdForBusinessObject(BusinessObject businessObject) {
47 PersistableBusinessObject pbo = (PersistableBusinessObject)businessObject;
48 return pbo.getObjectId();
49 }
50
51
52
53
54
55
56 public <T extends BusinessObject> Collection<T> retrieveSelectedResultBOs(Class<T> boClass, Set<String> lookupIds)
57 throws Exception {
58
59 Map<String, Collection<String>> queryCriteria = new HashMap<String, Collection<String>>();
60 queryCriteria.put(KRADPropertyConstants.OBJECT_ID, lookupIds);
61 return getBusinessObjectService().findMatching(boClass, queryCriteria);
62 }
63
64
65
66
67
68
69 public boolean qualifiesForStrategy(Class<? extends BusinessObject> boClass) {
70 return PersistableBusinessObject.class.isAssignableFrom(boClass);
71 }
72
73
74
75
76 public BusinessObjectService getBusinessObjectService() {
77 return this.businessObjectService;
78 }
79
80
81
82
83 public void setBusinessObjectService(BusinessObjectService businessObjectService) {
84 this.businessObjectService = businessObjectService;
85 }
86 }