Project

General

Profile

Download (3.23 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

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

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

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

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

    
65

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

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

    
79
    /**
80
     * @param taxon
81
     * @param classification
82
     * @return
83
     */
84
    Long countSiblingsOf(Taxon taxon, Classification classification);
85

    
86

    
87
}
(1-1/3)