fd36c8eb2786dabd95747bcc944fa3728fdc89df
[cdmlib.git] / cdmlib-persistence / src / main / java / eu / etaxonomy / cdm / persistence / dao / taxon / ITaxonNodeDao.java
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 import java.util.Map;
14 import java.util.Set;
15 import java.util.UUID;
16
17 import eu.etaxonomy.cdm.model.taxon.Classification;
18 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
19 import eu.etaxonomy.cdm.model.taxon.TaxonNodeAgentRelation;
20 import eu.etaxonomy.cdm.persistence.dao.common.IAnnotatableDao;
21 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
22
23 /**
24 * @author a.mueller
25 *
26 */
27 public interface ITaxonNodeDao extends IAnnotatableDao<TaxonNode> {
28
29 public UUID delete(TaxonNode persistentObject, boolean deleteChildren);
30
31 /**
32 *
33 * @return
34 */
35 public List<TaxonNode> getTaxonOfAcceptedTaxaByClassification(Classification classification, Integer start, Integer end);
36
37 /**
38 * @param classification
39 * @return
40 */
41 public int countTaxonOfAcceptedTaxaByClassification(Classification classification);
42
43 public List<TaxonNode> listChildrenOf(TaxonNode node, Integer pageSize, Integer pageIndex, List<String> propertyPaths, boolean recursive);
44
45 public abstract Long countChildrenOf(TaxonNode node, Classification classification, boolean recursive);
46
47 /**
48 * Returns the of TaxonNodeAgentRelation entities which are associated with the TaxonNode for the
49 * given TaxonUuid in the specified Classification.
50 *
51 * @param taxonUuid
52 * @param agentUuid TODO
53 * @param relTypeUuid TODO
54 * @param start
55 * @param limit
56 * @param propertyPaths
57 * @param rankId TODO
58 * @param classification
59 * @return
60 */
61 List<TaxonNodeAgentRelation> listTaxonNodeAgentRelations(UUID taxonUuid, UUID classificationUuid,
62 UUID agentUuid, UUID rankUuid, UUID relTypeUuid, Integer start, Integer limit, List<String> propertyPaths);
63
64 /**
65 * Returns the number of TaxonNodeAgentRelation entities which are associated with the TaxonNode for the
66 * given TaxonUuid in the specified Classification.
67 *
68 * @param taxonUuid
69 * @param agentUuid TODO
70 * @param relTypeUuid TODO
71 * @param rankId TODO
72 * @param classification
73 * @return
74 */
75 long countTaxonNodeAgentRelations(UUID taxonUuid, UUID classificationUuid, UUID agentUuid, UUID rankUuid, UUID relTypeUuid);
76
77 /**
78 * @param treeIndexClosure
79 * @param minRankOrderIndex
80 * @param maxRankOrderIndex
81 * @return
82 */
83 Map<String, Integer> rankOrderIndexForTreeIndex(List<String> treeIndexClosure, Integer minRankOrderIndex,
84 Integer maxRankOrderIndex);
85
86 /**
87 * @param keySet
88 * @return
89 */
90 Map<String, UuidAndTitleCache<?>> taxonUuidsForTreeIndexes(Set<String> keySet);
91
92 }