001/**
002 * Copyright 2005-2015 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.krad.criteria;
017
018import org.kuali.rice.core.api.criteria.GenericQueryResults;
019import org.kuali.rice.core.api.criteria.LookupCustomizer;
020import org.kuali.rice.core.api.criteria.QueryByCriteria;
021
022/**
023 * Defines basic methods that CriteriaLookup Dao's must provide
024 *
025 * @author Kuali Rice Team (rice.collab@kuali.org)
026 */
027public interface CriteriaLookupDao {
028
029    /**
030     * Looks up a type based on a query criteria.
031     *
032     * @param queryClass the class to lookup
033     * @param criteria the criteria to lookup against. cannot be null.
034     * @param <T> the type that is being looked up.
035     * @return the results. will never be null.
036     * @throws IllegalArgumentException if the criteria is null
037     */
038    <T> GenericQueryResults<T> lookup(final Class<T> queryClass, final QueryByCriteria criteria);
039
040    /**
041     * Looks up a type based on a query criteria.
042     *
043     * @param queryClass the class to lookup
044     * @param criteria the criteria to lookup against. cannot be null.
045     * @param <T> the type that is being looked up.
046     * @return the results. will never be null.
047     * @throws IllegalArgumentException if the criteria is null
048     */
049    <T> GenericQueryResults<T> lookup(final Class<T> queryClass, final QueryByCriteria criteria, LookupCustomizer<T> customizer);
050}