filter search results by secundum to exclude misappliednames
[cdmlib.git] / cdmlib-persistence / src / main / java / eu / etaxonomy / cdm / persistence / dao / taxon / ITaxonDao.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
14 import org.hibernate.criterion.Criterion;
15
16 import eu.etaxonomy.cdm.model.common.RelationshipBase;
17 import eu.etaxonomy.cdm.model.reference.ReferenceBase;
18 import eu.etaxonomy.cdm.model.taxon.Synonym;
19 import eu.etaxonomy.cdm.model.taxon.Taxon;
20 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
21 import eu.etaxonomy.cdm.persistence.dao.common.IIdentifiableDao;
22 import eu.etaxonomy.cdm.persistence.dao.common.ITitledDao;
23 import eu.etaxonomy.cdm.persistence.fetch.CdmFetch;
24
25 /**
26 * @author a.mueller
27 *
28 */
29 public interface ITaxonDao extends IIdentifiableDao<TaxonBase>, ITitledDao<TaxonBase> {
30
31 public List<TaxonBase> getTaxaByName(String name, ReferenceBase sec);
32
33 /**
34 * Computes all Taxon instances that do not have a taxonomic parent and has at least one child.
35 * @return The List<Taxon> of root taxa.
36 */
37 public List<Taxon> getRootTaxa(ReferenceBase sec);
38
39
40
41 /**
42 * Computes all Taxon instances that do not have a taxonomic parent.
43 * @param sec The concept reference that the taxon belongs to
44 * @param cdmFetch TODO
45 * @param onlyWithChildren if true only taxa are returned that have taxonomic children. <Br>Default: true.
46 * @return The List<Taxon> of root taxa.
47 */
48 public List<Taxon> getRootTaxa(ReferenceBase sec, CdmFetch cdmFetch, Boolean onlyWithChildren);
49
50 /**
51 * TODO necessary?
52 * @param pagesize max maximum number of returned taxa
53 * @param page page to start, with 0 being first page
54 * @return
55 */
56 public List<TaxonBase> getAllTaxa(Integer pagesize, Integer page);
57
58
59 /**
60 * @param limit
61 * @param start
62 * @return
63 */
64 public List<Synonym> getAllSynonyms(Integer limit, Integer start);
65
66 /**
67 * @param limit
68 * @param start
69 * @return
70 */
71 //public List<TaxonRelationship> getAllTaxonRelationships(Integer limit, Integer start);
72
73 /**
74 * @param limit
75 * @param start
76 * @return
77 */
78 //public List<SynonymRelationship> getAllSynonymRelationships(Integer limit, Integer start);
79
80 public List<RelationshipBase> getAllRelationships(Integer limit, Integer start);
81
82 /**
83 * Find taxa by searching for @{link NameBase}
84 * @param queryString
85 * @param matchMode
86 * @param page
87 * @param pagesize
88 * @param onlyAcccepted
89 * @return
90 */
91 public List<Taxon> findByName(String queryString, ITitledDao.MATCH_MODE matchMode, int page, int pagesize, boolean onlyAcccepted);
92
93 /**
94 * @param queryString
95 * @param matchMode
96 * @param onlyAcccepted
97 * @return
98 */
99 public int countMatchesByName(String queryString, ITitledDao.MATCH_MODE matchMode, boolean onlyAcccepted);
100
101 /**
102 * @param queryString
103 * @param matchMode
104 * @param onlyAcccepted
105 * @param criteria
106 * @return
107 */
108 public int countMatchesByName(String queryString, ITitledDao.MATCH_MODE matchMode, boolean onlyAcccepted, List<Criterion> criteria);
109
110 }