Project

General

Profile

Download (5.91 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.Collection;
13
import java.util.List;
14
import java.util.Map;
15
import java.util.Set;
16
import java.util.UUID;
17

    
18
import eu.etaxonomy.cdm.model.common.TreeIndex;
19
import eu.etaxonomy.cdm.model.reference.Reference;
20
import eu.etaxonomy.cdm.model.taxon.Classification;
21
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
22
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
23
import eu.etaxonomy.cdm.model.taxon.TaxonNodeAgentRelation;
24
import eu.etaxonomy.cdm.persistence.dao.common.IAnnotatableDao;
25
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
26
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
27

    
28
/**
29
 * @author a.mueller
30
 *
31
 */
32
public interface ITaxonNodeDao extends IAnnotatableDao<TaxonNode> {
33

    
34
	public UUID delete(TaxonNode persistentObject, boolean deleteChildren);
35

    
36
	/**
37
    *
38
    * @return
39
    */
40
   public List<TaxonNode> getTaxonOfAcceptedTaxaByClassification(Classification classification, Integer start, Integer end);
41

    
42
    /**
43
     * @param classification
44
     * @return
45
     */
46
    public int countTaxonOfAcceptedTaxaByClassification(Classification classification);
47

    
48
    /**
49
     * Lists all direct child nodes of the given {@link UuidAndTitleCache} which
50
     * represents the parent {@link TaxonNode}
51
     * @param parent a UuidAndTitleCache object which represents a parent {@link TaxonNode}
52
     * @return a list of UuidAndTitleCache objects that represent children of the
53
     * parent
54
     */
55
    public List<TaxonNodeDto> listChildNodesAsUuidAndTitleCache(UuidAndTitleCache<TaxonNode> parent);
56

    
57
    /**
58
     * Retrieves the parent node of the {@link TaxonNode} represented by the given {@link UuidAndTitleCache}.
59
     * @param child the child for which the parent should be retrieved
60
     * @return an UuidAndTitleCache object representing the parent node
61
     */
62
    public UuidAndTitleCache<TaxonNode> getParentUuidAndTitleCache(UuidAndTitleCache<TaxonNode> child);
63

    
64
    /**
65
     * Retrieves a list of {@link UuidAndTitleCache} objects that have a matching titleCache
66
     * @param limit the maximum results
67
     * @param pattern the titleCache that is searched for
68
     * @param classificationUuid if specified only nodes of this classification are retrieved
69
     * @return a list of matches
70
     */
71
    public List<UuidAndTitleCache<TaxonNode>> getUuidAndTitleCache(Integer limit, String pattern, UUID classificationUuid);
72

    
73
    public List<TaxonNode> listChildrenOf(TaxonNode node, Integer pageSize, Integer pageIndex, List<String> propertyPaths, boolean recursive);
74

    
75
    public abstract Long countChildrenOf(TaxonNode node, Classification classification, boolean recursive);
76

    
77
    /**
78
     * Returns the of TaxonNodeAgentRelation entities which are associated with the TaxonNode for the
79
     * given TaxonUuid in the specified Classification.
80
     *
81
     * @param taxonUuid
82
     * @param agentUuid TODO
83
     * @param relTypeUuid TODO
84
     * @param start
85
     * @param limit
86
     * @param propertyPaths
87
     * @param rankId TODO
88
     * @param classification
89
     * @return
90
     */
91
    List<TaxonNodeAgentRelation> listTaxonNodeAgentRelations(UUID taxonUuid, UUID classificationUuid,
92
            UUID agentUuid, UUID rankUuid, UUID relTypeUuid, Integer start, Integer limit, List<String> propertyPaths);
93

    
94
    /**
95
     * Returns the number of TaxonNodeAgentRelation entities which are associated with the TaxonNode for the
96
     * given TaxonUuid in the specified Classification.
97
     *
98
     * @param taxonUuid
99
     * @param agentUuid TODO
100
     * @param relTypeUuid TODO
101
     * @param rankId TODO
102
     * @param classification
103
     * @return
104
     */
105
    long countTaxonNodeAgentRelations(UUID taxonUuid, UUID classificationUuid, UUID agentUuid, UUID rankUuid, UUID relTypeUuid);
106

    
107
    /**
108
     * Computes a map treeIndex->rank(sortIndex) for each given taxon node treeIndex. Required by #5957.
109
     * If the taxon represented by the treeindex is not in the given rank range no record is returned for the given
110
     * treeindex.
111
     *
112
     * @param treeIndex the list of treeIndexes
113
     * @param minRankOrderIndex min rank
114
     * @param maxRankOrderIndex max rank
115
     * @return
116
     */
117
    Map<TreeIndex, Integer> rankOrderIndexForTreeIndex(List<TreeIndex> treeIndex, Integer minRankOrderIndex,
118
            Integer maxRankOrderIndex);
119

    
120
    /**
121
     * For a given set of taxon node tree indexes the uuid and title cache of the taxon represented
122
     * by this treeindex is returned.
123
     * @param treeIndexSet set of taxon node tree indexes
124
     * @return map with treeindex and uuidAndTitleCache of the represented taxon
125
     */
126
    Map<TreeIndex, UuidAndTitleCache<?>> taxonUuidsForTreeIndexes(Collection<TreeIndex> treeIndexSet);
127

    
128
    /**
129
     * @param ref
130
     * @return
131
     */
132
    public Set<TaxonBase> setSecundumForSubtreeAcceptedTaxa(TreeIndex subTreeIndex, Reference newSec, boolean overwriteExisting, boolean includeSharedTaxa, boolean emptyDetail);
133

    
134
    /**
135
     * @param ref
136
     */
137
    public  Set<TaxonBase> setSecundumForSubtreeSynonyms(TreeIndex subTreeIndex, Reference newSec, boolean overwriteExisting, boolean includeSharedTaxa, boolean emptyDetail);
138

    
139
    /**
140
     * @param subTreeIndex
141
     * @param publish
142
     * @param includeSharedTaxa
143
     * @return
144
     */
145
    public Set<TaxonBase> setPublishForSubtreeAcceptedTaxa(TreeIndex subTreeIndex, boolean publish, boolean includeSharedTaxa);
146

    
147
    /**
148
     * @param subTreeIndex
149
     * @param publish
150
     * @param includeSharedTaxa
151
     * @return
152
     */
153
    public Set<TaxonBase> setPublishForSubtreeSynonyms(TreeIndex subTreeIndex, boolean publish,
154
            boolean includeSharedTaxa);
155

    
156
}
(3-3/4)