View Javadoc

1   /*
2    * Copyright 2006-2007 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.rice.kns.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, boolean sortAscending);
48  
49      /**
50       * This method retrieves a collection of business objects populated with data, such that each record in the database populates a
51       * new object instance. This will retrieve business objects by class type and also by criteria passed in as key-value pairs,
52       * specifically attribute name and its expected value.
53       * 
54       * @param clazz
55       * @param fieldValues
56       * @return
57       */
58      public Collection findMatching(Class clazz, Map fieldValues);
59      
60      /**
61       * Retrieves a collection of business objects populated with data, such that each record in the database populates a new object
62       * instance. This will only retrieve business objects by class type.
63       * 
64       * @param clazz
65       * @return
66       */
67      public Collection findAllInactive(Class clazz);
68  
69  }