Project

General

Profile

Download (3.98 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2007 EDIT
4
* European Distributed Institute of Taxonomy 
5
* http://www.e-taxonomy.eu
6
* 
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10

    
11
package eu.etaxonomy.cdm.api.service;
12

    
13
import java.util.List;
14

    
15
import org.hibernate.criterion.Criterion;
16

    
17
import eu.etaxonomy.cdm.api.service.pager.Pager;
18
import eu.etaxonomy.cdm.model.common.ISourceable;
19
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
20
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
21
import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
22
import eu.etaxonomy.cdm.model.media.Rights;
23
import eu.etaxonomy.cdm.persistence.dao.BeanInitializer;
24
import eu.etaxonomy.cdm.persistence.query.MatchMode;
25
import eu.etaxonomy.cdm.persistence.query.OrderHint;
26

    
27
public interface IIdentifiableEntityService<T extends IdentifiableEntity> extends IAnnotatableService<T> {
28

    
29
	/**
30
	 * (Re-)generate the title caches for all objects of this concrete IdentifiableEntity class
31
	 */
32
	public void generateTitleCache();
33

    
34
	/**
35
	 * Return a Pager of sources belonging to this object
36
	 * 
37
	 * @param t The identifiable entity
38
	 * @param pageSize The maximum number of sources returned (can be null for all sources)
39
	 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
40
	 * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}
41
	 * @return a Pager of OriginalSource entities
42
	 */
43
    public Pager<IdentifiableSource> getSources(T t, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
44
    
45
	/**
46
	 * Return a Pager of rights belonging to this object
47
	 * 
48
	 * @param t The identifiable entity
49
	 * @param pageSize The maximum number of rights returned (can be null for all rights)
50
	 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
51
	 * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}
52
	 * @return a Pager of Rights entities
53
	 */
54
    public Pager<Rights> getRights(T t, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
55
    
56
    public ISourceable getSourcedObjectByIdInSource(Class clazz, String idInSource, String idNamespace);
57
    
58
	/**
59
	 * Return a list of all uuids mapped to titleCache in the convenient <code>UuidAndTitleCache</code> object.
60
	 * Retrieving this list is considered to be significantly faster than initializing the fully fledged buiseness
61
	 * objects. To be used in cases where you want to present large amount of data and provide details after 
62
	 * a selection has been made.  
63
	 * 
64
	 * @return a list of <code>UuidAndTitleCache</code> instances
65
	 */
66
	public List<UuidAndTitleCache<T>> getUuidAndTitleCache(); 
67
	
68
	/**
69
	 * Return a Pager of objects matching the given query string, optionally filtered by class, optionally with a particular MatchMode
70
	 * 
71
	 * @param clazz filter by class - can be null to include all instances of type T
72
	 * @param queryString the query string to filter by
73
	 * @param matchmode use a particular type of matching (can be null - defaults to exact matching)
74
	 * @param criteria additional criteria to filter by
75
	 * @param pageSize The maximum number of objects returned (can be null for all objects)
76
	 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
77
	 * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}
78
	 * @param orderHints
79
	 *            Supports path like <code>orderHints.propertyNames</code> which
80
	 *            include *-to-one properties like createdBy.username or
81
	 *            authorTeam.persistentTitleCache
82
	 * @return a paged list of instances of type T matching the queryString
83
	 */
84
    public Pager<T> findByTitle(Class<? extends T> clazz, String queryString,MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
85
}
(20-20/48)