View Javadoc

1   /*
2    * Copyright 2004 Carlos Sanchez.
3    * 
4    * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
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 net.sf.oness.common.model.dao;
17  
18  import java.util.Collection;
19  import java.util.List;
20  
21  import net.sf.oness.common.model.bo.AuditableBusinessObject;
22  import net.sf.oness.common.model.util.PaginatedList;
23  
24  /***
25   * Interface to be implemented by Data Access Objects with finder operations
26   * 
27   * @author Carlos Sanchez
28   * @version $Revision: 1.9 $
29   */
30  public interface FinderDao {
31  
32      /***
33       * Find a List of objects by their identifiers. This should return only the
34       * specified entity, not the associated ones.
35       * 
36       * @param ids
37       *            collection of identifiers
38       * @return the values with that ids
39       */
40      public List findById(Collection ids);
41  
42      /***
43       * Find objects with properties matching those of value. This should not
44       * return the associated entities. Properties whose value is null and
45       * Collections are ignored.
46       * 
47       * @param value
48       *            parameters to filter on
49       * @param firstElement
50       *            the first result, numbered from 0
51       * @param maxElements
52       *            the maximum number of results
53       * @return
54       */
55      public PaginatedList find(AuditableBusinessObject value, int firstElement,
56              int maxElements);
57  
58      /***
59       * Return all persistent instances
60       * 
61       * @return List of objects
62       */
63      public List findAll();
64  
65  }