001/**
002 * Copyright 2005-2016 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.dao;
017
018import java.util.Collection;
019import java.util.Map;
020
021/**
022 * Defines basic methods that Lookup Dao's must provide
023 * 
024 * @author Kuali Rice Team (rice.collab@kuali.org)
025 */
026public interface LookupDao {
027        public <T extends Object> Collection<T> findCollectionBySearchHelper(
028                        Class<T> example, Map<String, String> formProps, boolean unbounded,
029                        boolean usePrimaryKeyValuesOnly);
030
031        /**
032         * Retrieves a Object based on the search criteria, which should uniquely
033         * identify a record.
034         * 
035         * @return Object returned from the search
036         */
037        public <T extends Object> T findObjectByMap(T example, Map<String, String> formProps);
038
039        /**
040         * Returns a count of objects based on the given search parameters.
041         * 
042         * @return Long returned from the search
043         */
044        public Long findCountByMap(Object example, Map<String, String> formProps);
045
046        /**
047         * Create OJB criteria based on business object, search field and value
048         * 
049         * @return true if the criteria is created successfully; otherwise, return
050         *         false
051         */
052        public boolean createCriteria(Object example, String searchValue,
053                        String propertyName, Object criteria);
054
055        /**
056         * Create OJB criteria based on business object, search field and value
057         * 
058         * @return true if the criteria is created successfully; otherwise, return
059         *         false
060         */
061        public boolean createCriteria(Object example, String searchValue,
062                        String propertyName, boolean caseInsensitive,
063                        boolean treatWildcardsAndOperatorsAsLiteral, Object criteria);
064}