Merged in changes from cate-development branch and upgraded to spring 3.0.0.RC1
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / ICollectionService.java
1 package eu.etaxonomy.cdm.api.service;
2
3 import java.util.List;
4
5 import eu.etaxonomy.cdm.api.service.pager.Pager;
6 import eu.etaxonomy.cdm.model.occurrence.Collection;
7 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
8
9 import eu.etaxonomy.cdm.persistence.query.OrderHint;
10
11 public interface ICollectionService extends IIdentifiableEntityService<Collection> {
12
13 /**
14 * Returns a Paged List of Collection instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)
15 *
16 * @param clazz filter the results by class (or pass null to return all Collection instances)
17 * @param queryString
18 * @param pageSize The maximum number of collections returned (can be null for all matching collections)
19 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
20 * @param orderHints
21 * Supports path like <code>orderHints.propertyNames</code> which
22 * include *-to-one properties like createdBy.username or
23 * authorTeam.persistentTitleCache
24 * @param propertyPaths properties to be initialized
25 * @return a Pager Collection instances
26 * @see <a href="http://lucene.apache.org/java/2_4_0/queryparsersyntax.html">Apache Lucene - Query Parser Syntax</a>
27 */
28 public Pager<Collection> search(Class<? extends Collection> clazz, String query, Integer pageSize,Integer pageNumber, List<OrderHint> orderHints,List<String> propertyPaths);
29
30 /**
31 * Return a list of collections matching the given code
32 * @param code
33 * @return a List of Collection objects
34 */
35 public List<Collection> searchByCode(String code);
36 }