Project

General

Profile

Download (5.96 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2008 EDIT
3
* European Distributed Institute of Taxonomy 
4
* http://www.e-taxonomy.eu
5
*/
6

    
7
package eu.etaxonomy.cdm.persistence.dao.occurrence;
8

    
9
import java.util.List;
10

    
11
import org.springframework.dao.DataAccessException;
12

    
13
import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
14
import eu.etaxonomy.cdm.model.media.Media;
15
import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
16
import eu.etaxonomy.cdm.model.occurrence.DerivedUnitBase;
17
import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
18
import eu.etaxonomy.cdm.model.occurrence.FieldObservation;
19
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
20
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
21
import eu.etaxonomy.cdm.persistence.dao.BeanInitializer;
22
import eu.etaxonomy.cdm.persistence.dao.common.IIdentifiableDao;
23
import eu.etaxonomy.cdm.persistence.query.OrderHint;
24

    
25
/**
26
 * @author a.babadshanjan
27
 * @created 01.09.2008
28
 */
29
public interface IOccurrenceDao extends IIdentifiableDao<SpecimenOrObservationBase> {
30
	
31
	/**
32
	 * Returns the number of occurences belonging to a certain subclass - which must extend SpecimenOrObservationBase
33
	 * @param clazz optionally restrict the counted occurrences to those of a certain subclass of SpecimenOrObservationBase
34
	 * @param determinedAs the taxon concept that these specimens are determined to belong to 
35
	 * @return
36
	 */
37
	public int count(Class<? extends SpecimenOrObservationBase> clazz,TaxonBase determinedAs);
38
	
39
	/**
40
	 * Returns a sublist of SpecimenOrObservationBase instances stored in the database. A maximum
41
	 * of 'limit' objects are returned, starting at object with index 'start'. Only occurrences which 
42
	 * have been determined to belong to the supplied concept are returned.
43
	 * 
44
	 * @param type 
45
	 * @param determinedAs the taxon concept that these specimens are determined to belong to 
46
	 * @param limit
47
	 *            the maximum number of entities returned (can be null to return
48
	 *            all entities)
49
	 * @param start
50
	 * @param orderHints
51
	 *            Supports path like <code>orderHints.propertyNames</code> which
52
	 *            include *-to-one properties like createdBy.username or
53
	 *            authorTeam.persistentTitleCache
54
	 * @return
55
	 * @throws DataAccessException
56
	 */
57
	public List<SpecimenOrObservationBase> list(Class<? extends SpecimenOrObservationBase> type, TaxonBase determinedAs, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);
58
	
59
	/**
60
     * Returns a count of Media that are associated with a given occurence
61
     * 
62
	 * @param occurence the occurence associated with these media
63
     * @return a count of media instances
64
     */
65
	public int countMedia(SpecimenOrObservationBase occurence);
66
	
67
    /**
68
     * Returns a List of Media that are associated with a given occurence
69
     * 
70
	 * @param occurence the occurence associated with these media
71
	 * @param pageSize The maximum number of media returned (can be null for all related media)
72
	 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
73
	 * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}
74
     * @return a List of media instances
75
     */
76
	public List<Media> getMedia(SpecimenOrObservationBase occurence, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
77
	
78
	/**
79
     * Returns a count of determinations that have been made for a given occurence and for a given taxon concept
80
     * 
81
	 * @param occurence the occurence associated with these determinations (can be null for all occurrences)
82
	 * @param taxonbase the taxon concept associated with these determinations (can be null for all taxon concepts)
83
     * @return a count of determination events
84
     */
85
    public int countDeterminations(SpecimenOrObservationBase occurence,TaxonBase taxonbase);
86
	
87
    /**
88
     * Returns a List of determinations that have been made for a given occurence and for a given taxon concept
89
     * 
90
	 * @param occurence the occurence associated with these determinations (can be null for all occurrences)
91
	 * @param taxonbase the taxon concept associated with these determinations (can be null for all taxon concepts)
92
	 * @param pageSize The maximum number of determinations returned (can be null for all related determinations)
93
	 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
94
	 * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}
95
     * @return a List of determination instances
96
     */
97
	public List<DeterminationEvent> getDeterminations(SpecimenOrObservationBase occurence,TaxonBase taxonbase, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
98

    
99
	/**
100
     * Returns a count of derivation events that have involved creating new DerivedUnits from this occurence
101
     * 
102
	 * @param occurence the occurence that was a source of these derivation events
103
     * @return a count of derivation events
104
     */
105
    public int countDerivationEvents(SpecimenOrObservationBase occurence);
106
	
107
    /**
108
     * Returns a list of derivation events that have involved creating new DerivedUnits from this occurence
109
     * 
110
	 * @param occurence the occurence that was a source of these derivation events
111
	 * @param pageSize The maximum number of derivation events returned (can be null for all related derivation events)
112
	 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
113
	 * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}
114
     * @return a List of derivation events
115
     */
116
	public List<DerivationEvent> getDerivationEvents(SpecimenOrObservationBase occurence, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
117
	
118
	public List<UuidAndTitleCache<FieldObservation>> getFieldObservationUuidAndTitleCache();
119
	public List<UuidAndTitleCache<DerivedUnitBase>> getDerivedUnitBaseUuidAndTitleCache();
120
}
(2-2/2)