Methods to get all taxa and all taxon bases added to persistence and service layers
[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> getAllTaxonBases(Integer pagesize, Integer page);
57
58
59 /**
60 * @param limit
61 * @param start
62 * @return
63 */
64 public List<Taxon> getAllTaxa_(Integer limit, Integer start);
65
66 /**
67 * @param limit
68 * @param start
69 * @return
70 */
71 public List<Synonym> getAllSynonyms(Integer limit, Integer start);
72
73 /**
74 * @param limit
75 * @param start
76 * @return
77 */
78 //public List<TaxonRelationship> getAllTaxonRelationships(Integer limit, Integer start);
79
80 /**
81 * @param limit
82 * @param start
83 * @return
84 */
85 //public List<SynonymRelationship> getAllSynonymRelationships(Integer limit, Integer start);
86
87 public List<RelationshipBase> getAllRelationships(Integer limit, Integer start);
88
89 /**
90 * Find taxa by searching for @{link NameBase}
91 * @param queryString
92 * @param matchMode
93 * @param page
94 * @param pagesize
95 * @param onlyAcccepted
96 * @return
97 */
98 public List<Taxon> findByName(String queryString, ITitledDao.MATCH_MODE matchMode, int page, int pagesize, boolean onlyAcccepted);
99
100 /**
101 * @param queryString
102 * @param matchMode
103 * @param onlyAcccepted
104 * @return
105 */
106 public int countMatchesByName(String queryString, ITitledDao.MATCH_MODE matchMode, boolean onlyAcccepted);
107
108 /**
109 * @param queryString
110 * @param matchMode
111 * @param onlyAcccepted
112 * @param criteria
113 * @return
114 */
115 public int countMatchesByName(String queryString, ITitledDao.MATCH_MODE matchMode, boolean onlyAcccepted, List<Criterion> criteria);
116
117 }