| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| LookupDao |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Copyright 2005-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.dao; | |
| 17 | ||
| 18 | import java.util.Collection; | |
| 19 | import java.util.Map; | |
| 20 | ||
| 21 | /** | |
| 22 | * Defines basic methods that Lookup Dao's must provide | |
| 23 | * | |
| 24 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
| 25 | */ | |
| 26 | public interface LookupDao { | |
| 27 | public <T extends Object> Collection<T> findCollectionBySearchHelper( | |
| 28 | Class<T> example, Map<String, String> formProps, boolean unbounded, | |
| 29 | boolean usePrimaryKeyValuesOnly); | |
| 30 | ||
| 31 | public <T extends Object> Collection<T> findCollectionBySearchHelper( | |
| 32 | Class<T> example, Map<String, String> formProps, boolean unbounded, | |
| 33 | boolean usePrimaryKeyValuesOnly, Object additionalCriteria); | |
| 34 | ||
| 35 | /** | |
| 36 | * Retrieves a Object based on the search criteria, which should uniquely | |
| 37 | * identify a record. | |
| 38 | * | |
| 39 | * @return Object returned from the search | |
| 40 | */ | |
| 41 | public <T extends Object> T findObjectByMap(T example, Map<String, String> formProps); | |
| 42 | ||
| 43 | /** | |
| 44 | * Returns a count of objects based on the given search parameters. | |
| 45 | * | |
| 46 | * @return Long returned from the search | |
| 47 | */ | |
| 48 | public Long findCountByMap(Object example, Map<String, String> formProps); | |
| 49 | ||
| 50 | /** | |
| 51 | * Create OJB criteria based on business object, search field and value | |
| 52 | * | |
| 53 | * @return true if the criteria is created successfully; otherwise, return | |
| 54 | * false | |
| 55 | */ | |
| 56 | public boolean createCriteria(Object example, String searchValue, | |
| 57 | String propertyName, Object criteria); | |
| 58 | ||
| 59 | /** | |
| 60 | * Create OJB criteria based on business object, search field and value | |
| 61 | * | |
| 62 | * @return true if the criteria is created successfully; otherwise, return | |
| 63 | * false | |
| 64 | */ | |
| 65 | public boolean createCriteria(Object example, String searchValue, | |
| 66 | String propertyName, boolean caseInsensitive, | |
| 67 | boolean treatWildcardsAndOperatorsAsLiteral, Object criteria); | |
| 68 | } |