1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.sampleu.travel.options;
17
18 import edu.sampleu.travel.dataobject.TravelMileageRate;
19 import org.kuali.rice.core.api.criteria.QueryByCriteria;
20 import org.kuali.rice.core.api.criteria.QueryResults;
21 import org.kuali.rice.core.api.util.ConcreteKeyValue;
22 import org.kuali.rice.core.api.util.KeyValue;
23 import org.kuali.rice.krad.keyvalues.KeyValuesBase;
24 import org.kuali.rice.krad.service.KRADServiceLocator;
25
26 import java.util.ArrayList;
27 import java.util.List;
28
29
30
31
32
33
34 public class MileageRateKeyValues extends KeyValuesBase {
35 private static final long serialVersionUID = 1L;
36
37 @Override
38 public List<KeyValue> getKeyValues() {
39 List<KeyValue> keyValues = new ArrayList<KeyValue>();
40
41 QueryResults<TravelMileageRate> bos = KRADServiceLocator.getDataObjectService().findMatching( TravelMileageRate.class, QueryByCriteria
42 .Builder.create().build() );
43
44 keyValues.add(new ConcreteKeyValue("", ""));
45 for ( TravelMileageRate typ : bos.getResults() ) {
46 keyValues.add(new ConcreteKeyValue(typ.getMileageRateId(), typ.getMileageRateCd()));
47 }
48
49 return keyValues;
50 }
51
52 }