Project

General

Profile

« Previous | Next » 

Revision 892efc69

Added by Andreas Kohlbecker almost 14 years ago

merging /branches/cdmlib/SPRINT-Chichorieae1/ to trunk

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/occurrence/IOccurrenceDao.java
8 8

  
9 9
import java.util.List;
10 10

  
11
import org.springframework.dao.DataAccessException;
12

  
11 13
import eu.etaxonomy.cdm.model.media.Media;
12 14
import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
13 15
import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
14 16
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
17
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
15 18
import eu.etaxonomy.cdm.persistence.dao.BeanInitializer;
16 19
import eu.etaxonomy.cdm.persistence.dao.common.IIdentifiableDao;
20
import eu.etaxonomy.cdm.persistence.query.OrderHint;
17 21

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

  
62 96
	/**
63 97
     * Returns a count of derivation events that have involved creating new DerivedUnits from this occurence

Also available in: Unified diff