/**\r
* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
+* European Distributed Institute of Taxonomy\r
* http://www.e-taxonomy.eu\r
-* \r
+*\r
* The contents of this file are subject to the Mozilla Public License Version 1.1\r
* See LICENSE.TXT at the top of this package for the full license terms.\r
*/\r
\r
import java.util.List;\r
import java.util.Set;\r
+import java.util.UUID;\r
\r
import org.hibernate.criterion.Criterion;\r
\r
import eu.etaxonomy.cdm.model.common.RelationshipBase;\r
import eu.etaxonomy.cdm.model.common.RelationshipBase.Direction;\r
+import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;\r
import eu.etaxonomy.cdm.model.location.NamedArea;\r
import eu.etaxonomy.cdm.model.name.Rank;\r
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;\r
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;\r
+import eu.etaxonomy.cdm.model.reference.Reference;\r
+import eu.etaxonomy.cdm.model.taxon.Classification;\r
import eu.etaxonomy.cdm.model.taxon.Synonym;\r
import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;\r
import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;\r
import eu.etaxonomy.cdm.model.taxon.Taxon;\r
import eu.etaxonomy.cdm.model.taxon.TaxonBase;\r
+import eu.etaxonomy.cdm.model.taxon.TaxonNode;\r
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;\r
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;\r
-import eu.etaxonomy.cdm.persistence.dao.BeanInitializer;\r
import eu.etaxonomy.cdm.persistence.dao.common.IIdentifiableDao;\r
-import eu.etaxonomy.cdm.persistence.dao.common.ISearchableDao;\r
import eu.etaxonomy.cdm.persistence.dao.common.ITitledDao;\r
+import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;\r
import eu.etaxonomy.cdm.persistence.fetch.CdmFetch;\r
import eu.etaxonomy.cdm.persistence.query.MatchMode;\r
import eu.etaxonomy.cdm.persistence.query.OrderHint;\r
* @author a.mueller\r
*\r
*/\r
-public interface ITaxonDao extends IIdentifiableDao<TaxonBase>, ITitledDao<TaxonBase>, ISearchableDao<TaxonBase> {\r
- \r
-// /**\r
-// * Returns a count of TaxonBase instances (or Taxon instances, if accepted == true, or Synonym instance, if accepted == false) \r
-// * where the taxonBase.name.nameCache property matches the String queryString\r
-// * \r
-// * @param queryString\r
-// * @param accepted\r
-// * @param sec\r
-// * @return a count of the matching taxa\r
-// */\r
-// public int countTaxaByName(String queryString, Boolean accepted, ReferenceBase sec);\r
+public interface ITaxonDao extends IIdentifiableDao<TaxonBase>, ITitledDao<TaxonBase> {\r
+\r
+ /**\r
+ * Returns a list of TaxonBase instances where the taxon.titleCache property matches the name parameter,\r
+ * and taxon.sec matches the sec parameter.\r
+ * @param name\r
+ * @param sec\r
+ * @return\r
+ */\r
+ public List<TaxonBase> getTaxaByName(String name, Reference sec);\r
+\r
+ /**\r
+ * Returns a list of TaxonBase instances (or Taxon instances, if accepted == true, or Synonym instance, if accepted == false)\r
+ * where the taxonBase.name.nameCache property matches the String queryString, and taxon.sec matches the sec parameter.\r
+ * @param name\r
+ * @param sec\r
+ * @return\r
+ */\r
+ public List<TaxonBase> getTaxaByName(String queryString, Boolean accepted, Reference sec);\r
+\r
+ /**\r
+ * Returns a list of TaxonBase instances (or Taxon instances, if accepted == true, or Synonym instance, if accepted == false)\r
+ * where the taxonBase.name.nameCache property matches the String queryString.\r
+ * @param queryString\r
+ * @param matchMode\r
+ * @param accepted\r
+ * @param pageSize\r
+ * @param pageNumber\r
+ * @return\r
+ */\r
+ public List<TaxonBase> getTaxaByName(String queryString, MatchMode matchMode,\r
+ Boolean accepted, Integer pageSize, Integer pageNumber);\r
+\r
+\r
+ /**\r
+ * Returns a list of TaxonBase instances (or Taxon instances, if accepted == true, or Synonym instance, if accepted == false)\r
+ * where the taxonBase.name.nameCache property matches the String queryString.\r
+ * @param doTaxa\r
+ * @param doSynonyms\r
+ * @param queryString\r
+ * @param classification TODO\r
+ * @param matchMode\r
+ * @param namedAreas TODO\r
+ * @param pageSize\r
+ * @param pageNumber\r
+ * @param propertyPaths TODO\r
+ * @return list of found taxa\r
+ */\r
+ public List<TaxonBase> getTaxaByName(boolean doTaxa, boolean doSynonyms, boolean doMisappliedNames, String queryString, Classification classification,\r
+ MatchMode matchMode, Set<NamedArea> namedAreas, Integer pageSize, Integer pageNumber, List<String> propertyPaths);\r
+\r
+ /**\r
+ * @param doTaxa\r
+ * @param doSynonyms\r
+ * @param queryString\r
+ * @param classification TODO\r
+ * @param matchMode\r
+ * @param namedAreas\r
+ * @param pageSize\r
+ * @param pageNumber\r
+ * @param propertyPaths\r
+ * @return\r
+ */\r
+ public long countTaxaByName(boolean doTaxa, boolean doSynonyms, boolean doMisappliedNames, String queryString, Classification classification,\r
+\r
+ MatchMode matchMode, Set<NamedArea> namedAreas);\r
\r
-// /**\r
-// * Returns a count of TaxonBase instances where the\r
-// * taxon.name properties match the parameters passed.\r
-// * \r
-// * @param queryString search string\r
-// * @param matchMode way how search string shall be matched: exact, beginning, or anywhere\r
-// * @param selectMode either all taxon bases, or all taxa, or all synonyms\r
-// * @param sec reference\r
-// */ \r
-// public Integer countTaxaByName(String queryString, \r
-// MatchMode matchMode, SelectMode selectMode, ReferenceBase sec);\r
-\r
- /** \r
- * Returns a list of TaxonBase instances where the taxon.titleCache property matches the name parameter, \r
- * and taxon.sec matches the sec parameter.\r
- * @param name\r
- * @param sec\r
- * @return\r
- */\r
- public List<TaxonBase> getTaxaByName(String name, ReferenceBase sec);\r
- \r
- /** \r
- * Returns a list of TaxonBase instances (or Taxon instances, if accepted == true, or Synonym instance, if accepted == false) \r
- * where the taxonBase.name.nameCache property matches the String queryString, and taxon.sec matches the sec parameter.\r
- * @param name\r
- * @param sec\r
- * @return\r
- */\r
- public List<TaxonBase> getTaxaByName(String queryString, Boolean accepted, ReferenceBase sec);\r
-\r
- /** \r
- * Returns a list of TaxonBase instances (or Taxon instances, if accepted == true, or Synonym instance, if accepted == false) \r
- * where the taxonBase.name.nameCache property matches the String queryString.\r
- * @param queryString\r
- * @param matchMode\r
- * @param accepted\r
- * @param pageSize\r
- * @param pageNumber\r
- * @return\r
- */\r
- public List<TaxonBase> getTaxaByName(String queryString, MatchMode matchMode, \r
- Boolean accepted, Integer pageSize, Integer pageNumber);\r
- \r
- \r
- /** \r
- * Returns a list of TaxonBase instances (or Taxon instances, if accepted == true, or Synonym instance, if accepted == false) \r
- * where the taxonBase.name.nameCache property matches the String queryString.\r
- * @param clazz\r
- * @param queryString\r
- * @param matchMode\r
- * @param namedAreas TODO\r
- * @param pageSize\r
- * @param pageNumber\r
- * @param propertyPaths TODO\r
- * @return list of found taxa\r
- */\r
- public List<TaxonBase> getTaxaByName(Class<? extends TaxonBase> clazz, String queryString, MatchMode matchMode,\r
- ReferenceBase sec, Set<NamedArea> namedAreas, Integer pageSize, Integer pageNumber, List<String> propertyPaths);\r
-\r
- /**\r
- * @param clazz\r
- * @param queryString\r
- * @param matchMode\r
- * @param sec\r
- * @param namedAreas\r
- * @param pageSize\r
- * @param pageNumber\r
- * @param propertyPaths\r
- * @return\r
- */\r
- public long countTaxaByName(Class<? extends TaxonBase> clazz, String queryString, MatchMode matchMode,\r
- \r
- ReferenceBase sec, Set<NamedArea> namedAreas);\r
- \r
// /**\r
// * @param queryString\r
// * @param matchMode\r
// * @param accepted\r
// * @return\r
// */\r
-// public Integer countTaxaByName(String queryString, MatchMode matchMode, \r
+// public Integer countTaxaByName(String queryString, MatchMode matchMode,\r
// Boolean accepted);\r
- \r
+\r
// /**\r
// * Returns a count of TaxonBase instances where the\r
// * taxon.name properties match the parameters passed.\r
-// * \r
+// *\r
// * @param queryString search string\r
// * @param matchMode way how search string shall be matched: exact, beginning, or anywhere\r
// * @param selectModel all taxon base, taxa, or synonyms\r
-// */ \r
+// */\r
// public Integer countTaxaByName(String queryString, MatchMode matchMode, SelectMode selectMode);\r
\r
- /**\r
- * Computes all Taxon instances that do not have a taxonomic parent and has at least one child.\r
- * @return The List<Taxon> of root taxa.\r
- */\r
- public List<Taxon> getRootTaxa(ReferenceBase sec);\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 not used yet !! TODO\r
- * @param onlyWithChildren if true only taxa are returned that have taxonomic children. <Br>Default: true.\r
- * @param withMisaplications if false 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, Boolean withMisapplications);\r
- \r
- \r
- /**\r
- * Computes all Taxon instances which name is of a certain Rank.\r
- * \r
- * @param rank\r
- * The rank of the taxon name\r
- * @param sec\r
- * The concept reference that the taxon belongs to\r
- * @param cdmFetch\r
- * not used yet !! TODO\r
- * @param onlyWithChildren\r
- * if true only taxa are returned that have taxonomic children. <Br>\r
- * Default: true.\r
- * @param withMisaplications\r
- * if false only taxa are returned that have no\r
- * isMisappliedNameFor relationship.\r
- * @param propertyPaths\r
- * properties to be initialized, For detailed description and\r
- * examples <b>please refer to:</b>\r
- * {@link BeanInitializer#initialize(Object, List)}. <Br>\r
- * Default: true.\r
- * @return The List<Taxon> of root taxa.\r
- */\r
- public List<Taxon> \r
- getRootTaxa(Rank rank, ReferenceBase sec, CdmFetch cdmFetch, Boolean onlyWithChildren, Boolean withMisapplications, List<String> propertyPaths);\r
-\r
- /**\r
- * TODO necessary? \r
- * @param pagesize max maximum number of returned taxa\r
- * @param page page to start, with 0 being first page \r
- * @return\r
- */\r
- public List<TaxonBase> getAllTaxonBases(Integer pagesize, Integer page);\r
- \r
- \r
- /**\r
- * @param limit\r
- * @param start \r
- * @return\r
- */\r
- public List<Taxon> getAllTaxa(Integer limit, Integer start);\r
-\r
- /**\r
- * @param limit\r
- * @param start \r
- * @return\r
- */\r
- public List<Synonym> getAllSynonyms(Integer limit, Integer start);\r
-\r
- public List<RelationshipBase> getAllRelationships(Integer limit, Integer start); \r
-\r
- /**\r
- * Find taxa by searching for @{link NameBase}\r
- * @param queryString\r
- * @param matchMode\r
- * @param page\r
- * @param pagesize\r
- * @param onlyAcccepted\r
- * @return\r
- */\r
- public List<Taxon> findByName(String queryString, MatchMode matchMode, int page, int pagesize, boolean onlyAcccepted);\r
- \r
- /**\r
- * @param queryString\r
- * @param matchMode\r
- * @param onlyAcccepted\r
- * @return\r
- */\r
- public int countMatchesByName(String queryString, MatchMode matchMode, boolean onlyAcccepted);\r
- \r
- /**\r
- * @param queryString\r
- * @param matchMode\r
- * @param onlyAcccepted\r
- * @param criteria\r
- * @return\r
- */\r
- public int countMatchesByName(String queryString, MatchMode matchMode, boolean onlyAcccepted, List<Criterion> criteria);\r
- \r
- /**\r
- * Returns a count of the TaxonRelationships (of where relationship.type ==\r
- * type, if this argument is supplied) where the supplied taxon either is\r
- * relatedFrom or relatedTo depending on the <code>direction</code>\r
- * parameter.\r
- * \r
- * @param taxon\r
- * The taxon that is relatedFrom\r
- * @param type\r
- * The type of TaxonRelationship (can be null)\r
- * @param direction\r
- * specifies the direction of the relationship\r
- * @return the number of TaxonRelationship instances\r
- */\r
- public int countTaxonRelationships(Taxon taxon, TaxonRelationshipType type,\r
- Direction direction);\r
- \r
- /**\r
- * Returns the TaxonRelationships (of where relationship.type == type, if\r
- * this argument is supplied) where the supplied taxon either is\r
- * relatedFrom or relatedTo depending on the <code>direction</code>\r
- * parameter.\r
- * \r
- * @param taxon\r
- * The taxon that is relatedTo\r
- * @param type\r
- * The type of TaxonRelationship (can be null)\r
- * @param pageSize\r
- * The maximum number of relationships returned (can be null for\r
- * all relationships)\r
- * @param pageNumber\r
- * The offset (in pageSize chunks) from the start of the result\r
- * set (0 - based)\r
- * @param orderHints\r
- * Properties to order by\r
- * @param propertyPaths\r
- * Properties to initialize in the returned entities, following\r
- * the syntax described in\r
- * {@link BeanInitializer#initialize(Object, List)}\r
- * @param direction\r
- * specifies the direction of the relationship\r
- * @return a List of TaxonRelationship instances\r
- */\r
- public List<TaxonRelationship> getTaxonRelationships(Taxon taxon,\r
- TaxonRelationshipType type, Integer pageSize, Integer pageNumber,\r
- List<OrderHint> orderHints, List<String> propertyPaths,\r
- Direction direction);\r
- \r
- /**\r
- * Returns a count of the SynonymRelationships (of where relationship.type == type,\r
- * if this arguement is supplied) where the supplied taxon is relatedTo.\r
- * \r
- * @param taxon The taxon that is relatedTo\r
- * @param type The type of SynonymRelationship (can be null)\r
- * @return the number of SynonymRelationship instances\r
- */\r
- public int countSynonyms(Taxon taxon, SynonymRelationshipType type);\r
- \r
- /**\r
- * Returns the SynonymRelationships (of where relationship.type == type, if this arguement is supplied) \r
- * where the supplied taxon is relatedTo.\r
- * \r
- * @param taxon The taxon that is relatedTo\r
- * @param type The type of SynonymRelationship (can be null)\r
- * @param pageSize The maximum number of relationships returned (can be null for all relationships)\r
- * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
- * * @param orderHints Properties to order by\r
- * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link BeanInitializer#initialize(Object, List)}\r
- * @return a List of SynonymRelationship instances\r
- */\r
- public List<SynonymRelationship> getSynonyms(Taxon taxon, SynonymRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
- \r
- /**\r
- * Returns a count of TaxonBase instances where the\r
- * taxon.name properties match the parameters passed.\r
- * \r
- * @param clazz \r
- * @param uninomial\r
- * @param infragenericEpithet\r
- * @param specificEpithet\r
- * @param infraspecificEpithet\r
- * @param rank\r
- * @return a count of TaxonBase instances\r
- */\r
- public int countTaxaByName(Class<? extends TaxonBase> clazz, String uninomial, String infragenericEpithet,String specificEpithet, String infraspecificEpithet, Rank rank);\r
- \r
- /**\r
- * Returns a list of TaxonBase instances where the\r
- * taxon.name properties match the parameters passed. In order to search for any string value, pass '*', passing the string value of \r
- * <i>null</i> will search for those taxa with a value of null in that field\r
- * \r
- * @param clazz optionally filter by class (can be null to return all taxa)\r
- * @param uninomial \r
- * @param infragenericEpithet\r
- * @param specificEpithet\r
- * @param infraspecificEpithet\r
- * @param rank\r
- * @param pageSize The maximum number of taxa returned (can be null for all matching taxa)\r
- * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
- * @return a list of TaxonBase instances\r
- */\r
- public List<TaxonBase> findTaxaByName(Class<? extends TaxonBase> clazz, String uninomial, String infragenericEpithet, String specificEpithet, String infraspecificEpithet, Rank rank, Integer pageSize, Integer pageNumber);\r
- \r
- \r
+ /**\r
+ * Returns a count of TaxonBase instances where the\r
+ * taxon.name properties match the parameters passed.\r
+ *\r
+ * @param doTaxa\r
+ * @param doSynonyms\r
+ * @param uninomial\r
+ * @param infragenericEpithet\r
+ * @param specificEpithet\r
+ * @param infraspecificEpithet\r
+ * @param rank\r
+ * @return a count of TaxonBase instances\r
+ */\r
+ public int countTaxaByName(Class <? extends TaxonBase> clazz, String uninomial, String infragenericEpithet,String specificEpithet, String infraspecificEpithet, Rank rank);\r
+\r
+ /**\r
+ * Returns a list of TaxonBase instances where the\r
+ * taxon.name properties match the parameters passed. In order to search for any string value, pass '*', passing the string value of\r
+ * <i>null</i> will search for those taxa with a value of null in that field\r
+ * <p>\r
+ * Compare with\r
+ * {@link #findByName(String, MatchMode, int, int, boolean)}\r
+ * which searches for {@link TaxonNameBase}<strong><code>.titleCache</code>\r
+ * </strong>\r
+ *\r
+ * @param doTaxa\r
+ * @param doSynonyms\r
+ * @param uninomial\r
+ * @param infragenericEpithet\r
+ * @param specificEpithet\r
+ * @param infraspecificEpithet\r
+ * @param rank\r
+ * @param pageSize The maximum number of taxa returned (can be null for all matching taxa)\r
+ * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
+ * @return a list of TaxonBase instances\r
+ */\r
+ public List<TaxonBase> findTaxaByName(Class<? extends TaxonBase> clazz, String uninomial, String infragenericEpithet, String specificEpithet, String infraspecificEpithet, Rank rank, Integer pageSize, Integer pageNumber);\r
+\r
+ /**\r
+ * Find taxa by searching for Taxa and Synonyms where the\r
+ * {@link TaxonNameBase}<strong><code>.titleCache</code></strong> matches\r
+ * the name specified as queryString <code>taxonName</code>\r
+ * <P>\r
+ * Compare with\r
+ * {@link #findTaxaByName(Class, String, String, String, String, Rank, Integer, Integer)}\r
+ * which searches for {@link TaxonNameBase}<strong><code>.nameCache</code>\r
+ * </strong>\r
+ * @param queryString\r
+ * the taqxon Name to search for\r
+ * @param classification TODO\r
+ * @param matchMode\r
+ * @param namedAreas TODO\r
+ * @param pageNumber\r
+ * @param pageSize\r
+ * @param onlyAcccepted\r
+ * @return\r
+ */\r
+ public List<TaxonBase> findByNameTitleCache(boolean doTaxa, boolean doSynonyms, String queryString, Classification classification, MatchMode matchMode, Set<NamedArea> namedAreas, Integer pageNumber, Integer pageSize, List<String> propertyPaths) ;\r
+\r
+ /**\r
+ * Returns a taxon corresponding to the given uuid\r
+ *\r
+ * @param uuid\r
+ * The uuid of the taxon requested\r
+ * @param criteria\r
+ * Custom criteria to be added to the default list of applied criteria.\r
+ * @param propertyPaths\r
+ *\r
+ * @return\r
+ */\r
+ public TaxonBase findByUuid(UUID uuid, List<Criterion> criteria, List<String> propertyPaths);\r
+\r
+ /**\r
+ * Returns a list of Taxon entities corresponding to the given uuid list.\r
+ * @param uuids\r
+ * @param criteria\r
+ * @param propertyPaths\r
+ * @return\r
+ */\r
+ public List<? extends TaxonBase> findByUuids(List<UUID> uuids, List<Criterion> criteria, List<String> propertyPaths);\r
+\r
+ /**\r
+ * @param queryString\r
+ * @param classification\r
+ * @param matchMode\r
+ * @param namedAreas\r
+ * @param pageSize\r
+ * @param pageNumber\r
+ * @param propertyPaths\r
+ * @return A List of arrays. Each entry array holds the following entities: Taxon, CommonName, Description, Feature\r
+ */\r
+ public List<Object[]> getTaxaByCommonName(String queryString, Classification classification,\r
+ MatchMode matchMode, Set<NamedArea> namedAreas, Integer pageSize,\r
+ Integer pageNumber, List<String> propertyPaths);\r
+\r
+\r
+ /**\r
+ * Computes all Taxon instances that do not have a taxonomic parent and has at least one child.\r
+ * @return The List<Taxon> of root taxa.\r
+ * @deprecated obsolete when using classification\r
+ */\r
+ @Deprecated\r
+ public List<Taxon> getRootTaxa(Reference sec);\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 not used yet !! TODO\r
+ * @param onlyWithChildren if true only taxa are returned that have taxonomic children. <Br>Default: true.\r
+ * @param withMisaplications if false only taxa are returned that have no isMisappliedNameFor relationship.\r
+ * <Br>Default: true.\r
+ * @return The List<Taxon> of root taxa.\r
+ * @deprecated obsolete when using classification\r
+ */\r
+ @Deprecated\r
+ public List<Taxon> getRootTaxa(Reference sec, CdmFetch cdmFetch, Boolean onlyWithChildren, Boolean withMisapplications);\r
+\r
+\r
+ /**\r
+ * Computes all Taxon instances which name is of a certain Rank.\r
+ *\r
+ * @param rank\r
+ * The rank of the taxon name\r
+ * @param sec\r
+ * The concept reference that the taxon belongs to\r
+ * @param cdmFetch\r
+ * not used yet !! TODO\r
+ * @param onlyWithChildren\r
+ * if true only taxa are returned that have taxonomic children. <Br>\r
+ * Default: true.\r
+ * @param withMisaplications\r
+ * if false only taxa are returned that have no\r
+ * isMisappliedNameFor relationship.\r
+ * @param propertyPaths\r
+ * properties to be initialized, For detailed description and\r
+ * examples <b>please refer to:</b>\r
+ * {@link IBeanInitializer#initialize(Object, List)}. <Br>\r
+ * Default: true.\r
+ * @return The List<Taxon> of root taxa.\r
+ * @deprecated obsolete when using classification\r
+ */\r
+ @Deprecated\r
+ public List<Taxon>\r
+ getRootTaxa(Rank rank, Reference sec, CdmFetch cdmFetch, Boolean onlyWithChildren, Boolean withMisapplications, List<String> propertyPaths);\r
+\r
+ /**\r
+ * TODO necessary?\r
+ * @param pagesize max maximum number of returned taxa\r
+ * @param page page to start, with 0 being first page\r
+ * @return\r
+ */\r
+ public List<TaxonBase> getAllTaxonBases(Integer pagesize, Integer page);\r
+\r
+\r
+ /**\r
+ * @param limit\r
+ * @param start\r
+ * @return\r
+ */\r
+ public List<Taxon> getAllTaxa(Integer limit, Integer start);\r
+\r
+ /**\r
+ * @param limit\r
+ * @param start\r
+ * @return\r
+ */\r
+ public List<Synonym> getAllSynonyms(Integer limit, Integer start);\r
+\r
+ public List<RelationshipBase> getAllRelationships(Integer limit, Integer start);\r
+\r
+ public int countAllRelationships();\r
+\r
+ /**\r
+ * @param queryString\r
+ * @param matchMode\r
+ * @param onlyAcccepted\r
+ * @return\r
+ */\r
+ public int countMatchesByName(String queryString, MatchMode matchMode, boolean onlyAcccepted);\r
+\r
+ /**\r
+ * @param queryString\r
+ * @param matchMode\r
+ * @param onlyAcccepted\r
+ * @param criteria\r
+ * @return\r
+ */\r
+ public int countMatchesByName(String queryString, MatchMode matchMode, boolean onlyAcccepted, List<Criterion> criteria);\r
+\r
+ /**\r
+ * Returns a count of the TaxonRelationships (of where relationship.type ==\r
+ * type, if this argument is supplied) where the supplied taxon either is\r
+ * relatedFrom or relatedTo depending on the <code>direction</code>\r
+ * parameter.\r
+ *\r
+ * @param taxon\r
+ * The taxon that is relatedFrom\r
+ * @param type\r
+ * The type of TaxonRelationship (can be null)\r
+ * @param direction\r
+ * specifies the direction of the relationship\r
+ * @return the number of TaxonRelationship instances\r
+ */\r
+ public int countTaxonRelationships(Taxon taxon, TaxonRelationshipType type,\r
+ Direction direction);\r
+\r
+ /**\r
+ * Returns the TaxonRelationships (of where relationship.type == type, if\r
+ * this argument is supplied) where the supplied taxon either is\r
+ * relatedFrom or relatedTo depending on the <code>direction</code>\r
+ * parameter.\r
+ *\r
+ * @param taxon\r
+ * The taxon that is relatedTo\r
+ * @param type\r
+ * The type of TaxonRelationship (can be null)\r
+ * @param pageSize\r
+ * The maximum number of relationships returned (can be null for\r
+ * all relationships)\r
+ * @param pageNumber\r
+ * The offset (in pageSize chunks) from the start of the result\r
+ * set (0 - based)\r
+ * @param orderHints\r
+ * Properties to order by\r
+ * @param propertyPaths\r
+ * Properties to initialize in the returned entities, following\r
+ * the syntax described in\r
+ * {@link IBeanInitializer#initialize(Object, List)}\r
+ * @param direction\r
+ * specifies the direction of the relationship\r
+ * @return a List of TaxonRelationship instances\r
+ */\r
+ public List<TaxonRelationship> getTaxonRelationships(Taxon taxon,\r
+ TaxonRelationshipType type, Integer pageSize, Integer pageNumber,\r
+ List<OrderHint> orderHints, List<String> propertyPaths,\r
+ Direction direction);\r
+\r
+ /**\r
+ * Returns a count of the SynonymRelationships (of where relationship.type == type,\r
+ * if this arguement is supplied) where the supplied taxon is relatedTo.\r
+ *\r
+ * @param taxon The taxon that is relatedTo\r
+ * @param type The type of SynonymRelationship (can be null)\r
+ * @return the number of SynonymRelationship instances\r
+ */\r
+ public int countSynonyms(Taxon taxon, SynonymRelationshipType type);\r
+\r
+ /**\r
+ * Returns the SynonymRelationships (of where relationship.type == type, if this arguement is supplied)\r
+ * where the supplied taxon is relatedTo.\r
+ *\r
+ * @param taxon The taxon that is relatedTo\r
+ * @param type The type of SynonymRelationship (can be null)\r
+ * @param pageSize The maximum number of relationships returned (can be null for all relationships)\r
+ * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
+ * * @param orderHints Properties to order by\r
+ * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}\r
+ * @return a List of SynonymRelationship instances\r
+ */\r
+ public List<SynonymRelationship> getSynonyms(Taxon taxon, SynonymRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
+\r
+ /**\r
+ * Returns a count of the SynonymRelationships (of where relationship.type == type,\r
+ * if this arguement is supplied) where the supplied synonym is relatedFrom.\r
+ *\r
+ * @param taxon The synonym that is relatedFrom\r
+ * @param type The type of SynonymRelationship (can be null)\r
+ * @return the number of SynonymRelationship instances\r
+ */\r
+ public int countSynonyms(Synonym synonym, SynonymRelationshipType type);\r
+\r
+ /**\r
+ * Returns the SynonymRelationships (of where relationship.type == type, if this arguement is supplied)\r
+ * where the supplied synonym is relatedFrom.\r
+ *\r
+ * @param taxon The synonym that is relatedFrom\r
+ * @param type The type of SynonymRelationship (can be null)\r
+ * @param pageSize The maximum number of relationships returned (can be null for all relationships)\r
+ * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
+ * * @param orderHints Properties to order by\r
+ * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}\r
+ * @return a List of SynonymRelationship instances\r
+ */\r
+ public List<SynonymRelationship> getSynonyms(Synonym synoynm, SynonymRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
+\r
+ /**\r
+ *\r
+ * @return\r
+ */\r
+ public List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification);\r
+\r
+ /**\r
+ * Creates all inferred synonyms for the species in the tree and insert it to the database\r
+ * @param tree\r
+ * @return List of inferred synonyms\r
+ */\r
+ //public List<Synonym> insertAllInferredSynonymy(Classification tree);\r
+\r
+\r
+\r
+ public List<TaxonNameBase> findIdenticalTaxonNames(List<String> propertyPath);\r
+ public String getPhylumName(TaxonNameBase name);\r
+\r
+ public long countTaxaByCommonName(String searchString,\r
+ Classification classification, MatchMode matchMode,\r
+ Set<NamedArea> namedAreas);\r
+\r
+ /**\r
+ * Deletes all synonym relationships of a given synonym.\r
+ * If taxon is given only those relationships to the taxon\r
+ * are deleted.\r
+ * @param synonym the synonym\r
+ * @param taxon the taxon, may be <code>null</code>\r
+ * @return\r
+ * @deprecated This method must no longer being used since the\r
+ * SynonymRelationship is annotated at the {@link Taxon} and at\r
+ * the {@link Synonym} with <code>orphanDelete=true</code>. Just\r
+ * remove the from and to entities from the relationship and\r
+ * hibernate will care for the deletion. Using this method can cause\r
+ * <code>StaleStateException</code> (see http://dev.e-taxonomy.eu/trac/ticket/3797)\r
+ */\r
+ @Deprecated\r
+ public long deleteSynonymRelationships(Synonym syn, Taxon taxon);\r
+\r
+ public List<UUID> findIdenticalTaxonNameIds(List<String> propertyPath);\r
+\r
+ public List<TaxonNameBase> findIdenticalNamesNew(List <String> propertyPaths);\r
+\r
+\r
+ public Integer countSynonymRelationships(TaxonBase taxonBase,\r
+ SynonymRelationshipType type, Direction relatedfrom);\r
+\r
+ public List<SynonymRelationship> getSynonymRelationships(TaxonBase taxonBase,\r
+ SynonymRelationshipType type, Integer pageSize, Integer pageNumber,\r
+ List<OrderHint> orderHints, List<String> propertyPaths,\r
+ Direction relatedfrom);\r
+\r
+ /**\r
+ * @return\r
+ */\r
+ public List<UuidAndTitleCache<TaxonBase>> getUuidAndTitleCacheTaxon();\r
+\r
+ /**\r
+ * @return\r
+ */\r
+ public List<UuidAndTitleCache<TaxonBase>> getUuidAndTitleCacheSynonym();\r
+\r
+ public List<UuidAndTitleCache<TaxonBase>> getTaxaByNameForEditor(boolean doTaxa, boolean doSynonyms, String queryString, Classification classification,\r
+ MatchMode matchMode, Set<NamedArea> namedAreas);\r
+\r
+ public List<String> taxaByNameNotInDB(List<String> taxonNames);\r
+\r
+ public List<Taxon> listAcceptedTaxaFor(Synonym synonym, Classification classificationFilter, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints,\r
+ List<String> propertyPaths);\r
+\r
+ public long countAcceptedTaxaFor(Synonym synonym, Classification classificationFilter);\r
+\r
+\r
}\r