View Javadoc

1   /**
2    * Copyright 2005-2013 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.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  	/**
32  	 * Retrieves a Object based on the search criteria, which should uniquely
33  	 * identify a record.
34  	 * 
35  	 * @return Object returned from the search
36  	 */
37  	public <T extends Object> T findObjectByMap(T example, Map<String, String> formProps);
38  
39  	/**
40  	 * Returns a count of objects based on the given search parameters.
41  	 * 
42  	 * @return Long returned from the search
43  	 */
44  	public Long findCountByMap(Object example, Map<String, String> formProps);
45  
46  	/**
47  	 * Create OJB criteria based on business object, search field and value
48  	 * 
49  	 * @return true if the criteria is created successfully; otherwise, return
50  	 *         false
51  	 */
52  	public boolean createCriteria(Object example, String searchValue,
53  			String propertyName, Object criteria);
54  
55  	/**
56  	 * Create OJB criteria based on business object, search field and value
57  	 * 
58  	 * @return true if the criteria is created successfully; otherwise, return
59  	 *         false
60  	 */
61  	public boolean createCriteria(Object example, String searchValue,
62  			String propertyName, boolean caseInsensitive,
63  			boolean treatWildcardsAndOperatorsAsLiteral, Object criteria);
64  }