01: /*
02: * Copyright 2006-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.core.service;
17:
18: import java.util.Collection;
19: import java.util.Map;
20:
21: /**
22: * This class provides collection retrievals to populate key value pairs of business objects.
23: *
24: *
25: */
26: public interface KeyValuesService {
27:
28: /**
29: * Retrieves a collection of business objects populated with data, such that each record in the database populates a new object
30: * instance. This will only retrieve business objects by class type.
31: *
32: * @param clazz
33: * @return
34: */
35: public Collection findAll(Class clazz);
36:
37: /**
38: * Retrieves a collection of business objects populated with data, such that each record in the database populates a new object
39: * instance. This will only retrieve business objects by class type. Performs a sort on the result collection on the given sort
40: * field.
41: *
42: * @param clazz
43: * @param sortField - name of the field in the class to sort results by
44: * @param sortAscending - boolean indicating whether to sort ascending or descending
45: * @return
46: */
47: public Collection findAllOrderBy(Class clazz, String sortField,
48: boolean sortAscending);
49:
50: /**
51: * This method retrieves a collection of business objects populated with data, such that each record in the database populates a
52: * new object instance. This will retrieve business objects by class type and also by criteria passed in as key-value pairs,
53: * specifically attribute name and its expected value.
54: *
55: * @param clazz
56: * @param fieldValues
57: * @return
58: */
59: public Collection findMatching(Class clazz, Map fieldValues);
60: }
|