Project

General

Profile

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

    
10
package eu.etaxonomy.cdm.persistence.dao.taxon;
11

    
12
import java.util.List;
13

    
14
import eu.etaxonomy.cdm.model.name.Rank;
15
import eu.etaxonomy.cdm.model.taxon.Classification;
16
import eu.etaxonomy.cdm.model.taxon.Taxon;
17
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
18
import eu.etaxonomy.cdm.persistence.dao.common.IIdentifiableDao;
19
import eu.etaxonomy.cdm.persistence.dto.ClassificationLookupDTO;
20

    
21
/**
22
 * @author a.mueller
23
 *
24
 */
25
public interface IClassificationDao extends IIdentifiableDao<Classification> {
26

    
27
    /**
28
     * <p>
29
     * Lists all TaxonNodes of the specified tree for a given Rank. If a branch
30
     * does not contain a TaxonNode with a TaxonName at the given Rank the node
31
     * associated with the next lower Rank is taken as root node. If the
32
     * <code>rank</code> is null the absolute root nodes will be returned.
33
     * <p>
34
     * See <a href="http://dev.e-taxonomy.eu/trac/wiki/CdmClassificationRankSpecificRootnodes">http://dev.e-taxonomy.eu/trac/wiki/CdmClassificationRankSpecificRootnodes</a>
35
     * <p>
36
     * Since this method is using two queries which need to be run sequentially
37
     * the handling of limit and start is more complex and requires the total
38
     * count of the items matched by the first query is known. Therefore the
39
     * handling of limit and start must be managed in the service method that is
40
     * using this dao method.
41
     *
42
     * @param classification
43
     * @param rank
44
     *            may be null
45
     * @param limit
46
     *            The maximum number of objects returned (can be null for all
47
     *            matching objects)
48
     * @param start
49
     *            The offset from the start of the result set (0 - based, can be
50
     *            null - equivalent of starting at the beginning of the
51
     *            recordset)
52
     * @param propertyPaths
53
     * @param queryIndex
54
     *            0: execute first query, 1: excute second query, the second
55
     *            query is only available when parameter
56
     *            <code>rank != null</code>.
57
     * @return
58
     */
59
    public List<TaxonNode> listRankSpecificRootNodes(Classification classification, Rank rank, Integer limit, Integer start,
60
            List<String> propertyPaths, int queryIndex);
61

    
62
    public long[] countRankSpecificRootNodes(Classification classification, Rank rank);
63

    
64
    public List<TaxonNode> listChildrenOf(Taxon taxon, Classification classification, Integer pageSize, Integer pageIndex, List<String> propertyPaths);
65

    
66

    
67
    public Long countChildrenOf(Taxon taxon, Classification classification);
68

    
69
    public ClassificationLookupDTO classificationLookup(Classification classification);
70

    
71
    /**
72
     * @param taxon
73
     * @param classification
74
     * @param pageSize
75
     * @param pageIndex
76
     * @param propertyPaths
77
     * @return
78
     */
79
    List<TaxonNode> listSiblingsOf(Taxon taxon, Classification classification, Integer pageSize, Integer pageIndex,
80
            List<String> propertyPaths);
81

    
82
    /**
83
     * @param taxon
84
     * @param classification
85
     * @return
86
     */
87
    Long countSiblingsOf(Taxon taxon, Classification classification);
88

    
89

    
90
}
(1-1/3)