1 /** 2 * Copyright 2005-2014 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.krad.service.impl; 17 18 import org.kuali.rice.core.api.criteria.QueryByCriteria; 19 20 import java.util.List; 21 import java.util.Map; 22 23 /** 24 * Handles generating QueryByCriteria for lookups from a given Map of the properties submitted on the lookup form. 25 * 26 * @author Kuali Rice Team (rice.collab@kuali.org) 27 */ 28 public interface LookupCriteriaGenerator { 29 30 /** 31 * Generates QueryByCriteria for lookup search criteria obtained from the lookup form. 32 * 33 * @param type 34 * @param formProps 35 * @param usePrimaryKeysOnly 36 * @return 37 * @deprecated please use {@link #generateCriteria(Class, java.util.Map, java.util.List, boolean)} instead 38 */ 39 @Deprecated 40 QueryByCriteria.Builder generateCriteria(Class<?> type, Map<String, String> formProps, boolean usePrimaryKeysOnly); 41 42 /** 43 * Generates QueryByCriteria for lookup search criteria obtained from the lookup form. 44 * 45 * <p> 46 * This implementation better isolates the UIFramework from the lookup service. 47 * </p> 48 * 49 * @param type the class name of the object on which the lookup is performed. 50 * @param formProps a Map containing the form properties to be used as search criteria. 51 * @param wildcardAsLiteralPropertyNames list of properties that have wildcards disabled, any wildcard characters 52 * are treated as literals. 53 * @param usePrimaryKeysOnly determines whether only primary keys are used in search 54 * @return QueryByCriteria.Builder 55 */ 56 QueryByCriteria.Builder generateCriteria(Class<?> type, Map<String, String> formProps, 57 List<String> wildcardAsLiteralPropertyNames, boolean usePrimaryKeysOnly); 58 59 QueryByCriteria.Builder createObjectCriteriaFromMap(Object example, Map<String, String> formProps); 60 }