| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| KeyValuesService | 
  | 
  | 1.0;1 | 
| 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 |  import org.kuali.rice.kns.bo.BusinessObject; | |
| 22 | ||
| 23 |  /** | |
| 24 |   * This class provides collection retrievals to populate key value pairs of business objects. | |
| 25 |   *  | |
| 26 |   *  | |
| 27 |   */ | |
| 28 | public interface KeyValuesService {  | |
| 29 | ||
| 30 |      /** | |
| 31 |       * Retrieves a collection of business objects populated with data, such that each record in the database populates a new object | |
| 32 |       * instance. This will only retrieve business objects by class type. | |
| 33 |       *  | |
| 34 |       * @param clazz | |
| 35 |       * @return | |
| 36 |       */ | |
| 37 | public <T extends BusinessObject> Collection<T> findAll(Class<T> clazz);  | |
| 38 | ||
| 39 |      /** | |
| 40 |       * Retrieves a collection of business objects populated with data, such that each record in the database populates a new object | |
| 41 |       * instance. This will only retrieve business objects by class type. Performs a sort on the result collection on the given sort | |
| 42 |       * field. | |
| 43 |       *  | |
| 44 |       * @param clazz | |
| 45 |       * @param sortField - name of the field in the class to sort results by | |
| 46 |       * @param sortAscending - boolean indicating whether to sort ascending or descending | |
| 47 |       * @return | |
| 48 |       */ | |
| 49 | public <T extends BusinessObject> Collection<T> findAllOrderBy(Class<T> clazz, String sortField, boolean sortAscending);  | |
| 50 | ||
| 51 |      /** | |
| 52 |       * This method retrieves a collection of business objects populated with data, such that each record in the database populates a | |
| 53 |       * new object instance. This will retrieve business objects by class type and also by criteria passed in as key-value pairs, | |
| 54 |       * specifically attribute name and its expected value. | |
| 55 |       *  | |
| 56 |       * @param clazz | |
| 57 |       * @param fieldValues | |
| 58 |       * @return | |
| 59 |       */ | |
| 60 | public <T extends BusinessObject> Collection<T> findMatching(Class<T> clazz, Map<String, Object> fieldValues);  | |
| 61 | ||
| 62 |      /** | |
| 63 |       * Retrieves a collection of business objects populated with data, such that each record in the database populates a new object | |
| 64 |       * instance. This will only retrieve business objects by class type. | |
| 65 |       *  | |
| 66 |       * @param clazz | |
| 67 |       * @return | |
| 68 |       */ | |
| 69 | public <T extends BusinessObject> Collection<T> findAllInactive(Class<T> clazz);  | |
| 70 | ||
| 71 | }  |