* @see eu.etaxonomy.cdm.persistence.dao.taxon.ITaxonDao#getRootTaxa(eu.etaxonomy.cdm.model.reference.ReferenceBase)\r
*/\r
public List<Taxon> getRootTaxa(ReferenceBase sec) {\r
- return getRootTaxa(sec, CdmFetch.FETCH_CHILDTAXA(), true);\r
+ return getRootTaxa(sec, CdmFetch.FETCH_CHILDTAXA(), true, false);\r
}\r
+ \r
\r
/* (non-Javadoc)\r
* @see eu.etaxonomy.cdm.persistence.dao.taxon.ITaxonDao#getRootTaxa(eu.etaxonomy.cdm.model.reference.ReferenceBase, boolean)\r
*/\r
- public List<Taxon> getRootTaxa(ReferenceBase sec, CdmFetch cdmFetch, Boolean onlyWithChildren) {\r
+ public List<Taxon> getRootTaxa(ReferenceBase sec, CdmFetch cdmFetch, Boolean onlyWithChildren, Boolean withMisaplications) {\r
if (onlyWithChildren == null){\r
onlyWithChildren = true;\r
}\r
+ if (withMisaplications == null){\r
+ withMisaplications = true;\r
+ }\r
if (cdmFetch == null){\r
cdmFetch = CdmFetch.NO_FETCH();\r
}\r
\r
\r
if (! cdmFetch.includes(CdmFetch.FETCH_CHILDTAXA())){\r
- logger.warn("no child taxa fetch qq");\r
+ logger.warn("no child taxa fetch");\r
//TODO overwrite LAZY (SELECT) does not work (bug in hibernate?)\r
crit.setFetchMode("relationsToThisTaxon.fromTaxon", FetchMode.LAZY);\r
}\r
\r
List<Taxon> results = new ArrayList<Taxon>();\r
for(Taxon taxon : (List<Taxon>) crit.list()){\r
+ //childTaxa\r
+ //TODO create restriction instead\r
if (onlyWithChildren == false || taxon.hasTaxonomicChildren()){\r
- results.add(taxon);\r
+ if (withMisaplications == false || ! taxon.isMisappliedName()){\r
+ results.add(taxon);\r
+ }\r
}\r
}\r
return results;\r
public List<Taxon> getRootTaxa(ReferenceBase sec);\r
\r
\r
- \r
/**\r
* Computes all Taxon instances that do not have a taxonomic parent.\r
* @param sec The concept reference that the taxon belongs to\r
- * @param cdmFetch TODO\r
+ * @param cdmFetch not used yet !! TODO\r
* @param onlyWithChildren if true only taxa are returned that have taxonomic children. <Br>Default: true.\r
+ * @param withMisaplications if true only taxa are returned that have no isMisappliedNameFor relationship. \r
+ * <Br>Default: true.\r
* @return The List<Taxon> of root taxa.\r
*/\r
- public List<Taxon> getRootTaxa(ReferenceBase sec, CdmFetch cdmFetch, Boolean onlyWithChildren);\r
-\r
+ public List<Taxon> getRootTaxa(ReferenceBase sec, CdmFetch cdmFetch, Boolean onlyWithChildren, Boolean withMisaplications);\r
+ \r
+ \r
/**\r
* TODO necessary? \r
* @param pagesize max maximum number of returned taxa\r