- added service method to term service that retrieves terms by TermType
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / INameService.java
index 7ad053f21ce4a30a4aba01dae3b7b8a4446c9fd2..a03df682231963ed4c31aa2baac8f6229c7f0131 100644 (file)
@@ -1,26 +1,32 @@
 // $Id$\r
 /**\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
 package eu.etaxonomy.cdm.api.service;\r
 \r
+import java.io.IOException;\r
 import java.util.Collection;\r
 import java.util.List;\r
 import java.util.Map;\r
 import java.util.UUID;\r
 \r
+import org.apache.lucene.index.CorruptIndexException;\r
+import org.apache.lucene.queryParser.ParseException;\r
 import org.hibernate.criterion.Criterion;\r
 \r
 import eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator;\r
-import eu.etaxonomy.cdm.api.service.config.ReferencedObjectUndeletableException;\r
+import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException;\r
 import eu.etaxonomy.cdm.api.service.pager.Pager;\r
+import eu.etaxonomy.cdm.api.service.search.DocumentSearchResult;\r
+import eu.etaxonomy.cdm.api.service.search.SearchResult;\r
 import eu.etaxonomy.cdm.model.common.CdmBase;\r
+import eu.etaxonomy.cdm.model.common.Language;\r
 import eu.etaxonomy.cdm.model.common.OrderedTermVocabulary;\r
 import eu.etaxonomy.cdm.model.common.ReferencedEntityBase;\r
 import eu.etaxonomy.cdm.model.common.RelationshipBase;\r
@@ -38,7 +44,7 @@ import eu.etaxonomy.cdm.model.name.Rank;
 import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus;\r
 import eu.etaxonomy.cdm.model.name.TaxonNameBase;\r
 import eu.etaxonomy.cdm.model.name.TypeDesignationBase;\r
-import eu.etaxonomy.cdm.persistence.dao.BeanInitializer;\r
+import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;\r
 import eu.etaxonomy.cdm.persistence.query.MatchMode;\r
 import eu.etaxonomy.cdm.persistence.query.OrderHint;\r
 import eu.etaxonomy.cdm.strategy.cache.TaggedText;\r
@@ -46,14 +52,14 @@ import eu.etaxonomy.cdm.strategy.cache.TaggedText;
 public interface INameService extends IIdentifiableEntityService<TaxonNameBase> {\r
 \r
        /**\r
-        * Deletes a name. Depening on the configurator state links to the name will either be \r
+        * Deletes a name. Depening on the configurator state links to the name will either be\r
         * deleted or throw exceptions.<BR>\r
         * If name is <code>null</code> this method has no effect.\r
         * @param name\r
         * @param config\r
-        * @throws ReferencedObjectUndeletableException \r
+        * \r
         */\r
-       public UUID delete(TaxonNameBase name, NameDeletionConfigurator config) throws ReferencedObjectUndeletableException;\r
+       public String delete(TaxonNameBase name, NameDeletionConfigurator config);\r
 \r
        /**\r
         * Removes the given type designation from the given taxon name and deletes it from\r
@@ -67,7 +73,7 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
         */\r
        public void deleteTypeDesignation(TaxonNameBase name, TypeDesignationBase typeDesignation);\r
 \r
-       \r
+\r
        /**\r
         * Saves the given type designations.\r
         * @param typeDesignationCollection\r
@@ -76,7 +82,7 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
        public Map<UUID, TypeDesignationBase> saveTypeDesignationAll(Collection<TypeDesignationBase> typeDesignationCollection);\r
 \r
        public Map<UUID, ReferencedEntityBase> saveReferencedEntitiesAll(Collection<ReferencedEntityBase> referencedEntityCollection);\r
-               \r
+\r
        /**\r
         * Saves the given homotypical groups.\r
         * @param homotypicalGroups\r
@@ -99,13 +105,13 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
         * @return\r
         */\r
        public List<TypeDesignationBase> getAllTypeDesignations(int limit, int start);\r
-       \r
+\r
        /**\r
         * @param name\r
         * @return\r
         */\r
        public List<TaxonNameBase> getNamesByName(String name);\r
-       \r
+\r
        /**\r
         * Returns all NonViralNames with a name cache that matches the given string\r
         * @param name\r
@@ -113,6 +119,37 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
         */\r
        public List<NonViralName> getNamesByNameCache(String nameCache);\r
 \r
+       /**\r
+        * Returns all NonViralNames with a title cache that matches the given string\r
+        * using the given match mode and initialization strategy\r
+        *\r
+        * @param name\r
+        * @param matchMode\r
+        * @param propertyPaths\r
+        * @return\r
+        */\r
+       public List<NonViralName> findNamesByTitleCache(String titleCache, MatchMode matchMode, List<String> propertyPaths);\r
+\r
+       /**\r
+        * Returns all NonViralNames with a name cache that matches the given string\r
+        * using the given match mode and initialization strategy\r
+        *\r
+        * @param name\r
+        * @param matchMode\r
+        * @param propertyPaths\r
+        * @return\r
+        */\r
+       public List<NonViralName> findNamesByNameCache(String nameCache, MatchMode matchMode, List<String> propertyPaths);\r
+\r
+       /**\r
+        * Returns the NonViralName with the given UUID\r
+        * using the given match mode and initialization strategy\r
+        *\r
+        * @param uuid\r
+        * @param propertyPaths\r
+        * @return\r
+        */\r
+       public NonViralName findNameByUuid(UUID uuid, List<String> propertyPaths);\r
        /**\r
         * @param name\r
         * @param sessionObject An object that is attached to the session before executing the query\r
@@ -120,57 +157,158 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
         */\r
        public List getNamesByName(String name, CdmBase sessionObject);\r
        \r
-       // TODO: Remove getNamesByName() methods. Use findNamesByTitle() instead.\r
+       /**\r
+        * Fuzzy matching for the taxon name elements. The input name is first atomised using the {@link NonViralNameParserImpl}\r
+        * into its separate parts (genusOrUninomial,infraGenericEpithet,specificEpithet,infraGenericEpithet,authorshipCache).\r
+        * Each field is then matched separately with the same accuracy parameter.\r
+        *  \r
+        * @param name taxon name to fuzzy match\r
+        * @param accuracy value > 0.0 and < 1.0 which determines the accuracy of the result.\r
+        * @param languages list of languages to consider when matching (currently not used)\r
+        * @param highlightFragments\r
+        * @param propertyPaths \r
+        * @param maxNoOfResults \r
+        * @return\r
+        * @throws CorruptIndexException\r
+        * @throws IOException\r
+        * @throws ParseException\r
+        */\r
+       public List<SearchResult<TaxonNameBase>> findByNameFuzzySearch(\r
+            String name,\r
+            float accuracy,\r
+            List<Language> languages,\r
+            boolean highlightFragments, \r
+            List<String> propertyPaths,\r
+            int maxNoOfResults) throws CorruptIndexException, IOException, ParseException;\r
        \r
+       /**\r
+        * Fuzzy matching for the taxon name elements using only the lucene index. \r
+        * \r
+        * The input name is first atomised using the {@link NonViralNameParserImpl}\r
+        * into its separate parts (genusOrUninomial,infraGenericEpithet,specificEpithet,infraGenericEpithet,authorshipCache).\r
+        * Each field is then matched separately with the same accuracy parameter.\r
+        *  \r
+        * @param name taxon name to fuzzy match\r
+        * @param accuracy value > 0.0 and < 1.0 which determines the accuracy of the result.\r
+        * @param languages list of languages to consider when matching (currently not used)\r
+        * @param highlightFragments\r
+        * @param maxNoOfResults \r
+        * @return\r
+        * @throws CorruptIndexException\r
+        * @throws IOException\r
+        * @throws ParseException\r
+        */\r
+    public List<DocumentSearchResult> findByNameFuzzySearch(\r
+            String name,\r
+            float accuracy,\r
+            List<Language> languages,\r
+            boolean highlightFragments, \r
+            int maxNoOfResults) throws CorruptIndexException, IOException, ParseException;\r
+    \r
+       /**\r
+        * Fuzzy matching against the name cache using only the lucene index. \r
+        * \r
+        *  \r
+        * @param name taxon name to fuzzy match\r
+        * @param accuracy value > 0.0 and < 1.0 which determines the accuracy of the result.\r
+        * @param languages list of languages to consider when matching (currently not used)\r
+        * @param highlightFragments\r
+        * @param maxNoOfResults \r
+        * @return\r
+        * @throws CorruptIndexException\r
+        * @throws IOException\r
+        * @throws ParseException\r
+        */\r
+    public List<DocumentSearchResult> findByFuzzyNameCacheSearch(\r
+            String name,\r
+            float accuracy,\r
+            List<Language> languages,\r
+            boolean highlightFragments, \r
+            int maxNoOfResults) throws CorruptIndexException, IOException, ParseException;\r
+    \r
+       /**\r
+        * Exact matching for the taxon name elements using only the lucene index.\r
+        * \r
+        * The input name is first atomised using the {@link NonViralNameParserImpl}\r
+        * into its separate parts (genusOrUninomial,infraGenericEpithet,specificEpithet,infraGenericEpithet,authorshipCache).\r
+        * Each field is then matched separately with the same accuracy parameter.\r
+        *  \r
+        * @param name taxon name to fuzzy match\r
+        * @param wildcard boolean flag to indicate whether a wildcard '*' should be added at the end of the query\r
+        * @param languages list of languages to consider when matching (currently not used)\r
+        * @param highlightFragments\r
+        * @param maxNoOfResults \r
+        * @return\r
+        * @throws CorruptIndexException\r
+        * @throws IOException\r
+        * @throws ParseException\r
+        */\r
+    \r
+    public List<DocumentSearchResult> findByNameExactSearch(\r
+            String name,      \r
+            boolean wildcard,\r
+            List<Language> languages,\r
+            boolean highlightFragments, \r
+            int maxNoOfResults) throws CorruptIndexException, IOException, ParseException;\r
+\r
+       // TODO: Remove getNamesByName() methods. Use findNamesByTitle() instead.\r
+\r
        // FIXME candidate for harmonization?\r
        public List findNamesByTitle(String title);\r
-       \r
+\r
        public List findNamesByTitle(String title, CdmBase sessionObject);\r
-       \r
+\r
     public List<HomotypicalGroup> getAllHomotypicalGroups(int limit, int start);\r
 \r
        @Deprecated\r
     public List<RelationshipBase> getAllRelationships(int limit, int start);\r
-    \r
+\r
        /**\r
         * Returns all Ranks\r
         * @return\r
-        * @deprecated use VocabularyService#getVocabulary(VocabularyEnum) instead\r
+        * @deprecated use VocabularyService#getVocabulary(VocabularyEnum) instead,\r
+        *   this is not possible since  VocabularyService#getVocabulary(VocabularyEnum)\r
+        *   is not returning a OrderedTermVocabulary !!! see also http://dev.e-taxonomy.eu/trac/ticket/3327\r
         */\r
-       public OrderedTermVocabulary<Rank> getRankVocabulary();\r
-       \r
+       @Deprecated\r
+    public OrderedTermVocabulary<Rank> getRankVocabulary();\r
+\r
        /**\r
         * Returns all NomenclaturalStatusTypes\r
         * @return\r
         * @deprecated use VocabularyService#getVocabulary(VocabularyEnum) instead\r
         */\r
-       public TermVocabulary<NomenclaturalStatusType> getStatusTypeVocabulary();\r
-       \r
+       @Deprecated\r
+    public TermVocabulary<NomenclaturalStatusType> getStatusTypeVocabulary();\r
+\r
        /**\r
         * Returns TypeDesignationStatus vocabulary\r
         * @return\r
         * @deprecated use VocabularyService#getVocabulary(VocabularyEnum) instead\r
         */\r
-       public TermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationStatusVocabulary();\r
-               \r
+       @Deprecated\r
+    public TermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationStatusVocabulary();\r
+\r
        /**\r
         * Returns TypeDesignationStatus ordered vocabulary\r
         * @return\r
         * @deprecated use VocabularyService#getVocabulary(VocabularyEnum) instead\r
         */\r
-       public OrderedTermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationVocabulary();\r
+       @Deprecated\r
+    public OrderedTermVocabulary<SpecimenTypeDesignationStatus> getSpecimenTypeDesignationVocabulary();\r
 \r
        /**\r
         * Returns all NameRelationshipTypes\r
         * @return\r
         * @deprecated use VocabularyService#getVocabulary(VocabularyEnum) instead\r
         */\r
-       public TermVocabulary<NameRelationshipType> getNameRelationshipTypeVocabulary();\r
-       \r
+       @Deprecated\r
+    public TermVocabulary<NameRelationshipType> getNameRelationshipTypeVocabulary();\r
+\r
        /**\r
         * Return a List of name relationships in which this name is related to\r
         * another name, optionally filtered by relationship type\r
-        * \r
+        *\r
         * @param name\r
         *            the name on either the <i>"from side"</i> or on the\r
         *            <i>"to side"</i> of the relationship, depending on the\r
@@ -189,125 +327,125 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
         *            may be null\r
         * @param propertyPaths\r
         *            properties to initialize - see\r
-        *            {@link BeanInitializer#initialize(Object, List)}\r
+        *            {@link IBeanInitializer#initialize(Object, List)}\r
         * @return a Pager of NameRelationship instances\r
         */\r
        public List<NameRelationship> listNameRelationships(TaxonNameBase name,  NameRelationship.Direction direction, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
-       \r
+\r
        /**\r
-        * Return a List of name relationships in which this name is related to another name, optionally filtered \r
+        * Return a List of name relationships in which this name is related to another name, optionally filtered\r
         * by relationship type\r
-        * \r
+        *\r
         * @param name the name on the <i>"from side"</i> of the relationship\r
         * @param direction the direction of the NameRelationship\r
-        * @param type the relationship type (or null to return all relationships) \r
+        * @param type the relationship type (or null to return all relationships)\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 may be null\r
-        * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}\r
+        * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}\r
         * @return a Pager of NameRelationship instances\r
         */\r
        public Pager<NameRelationship> pageNameRelationships(TaxonNameBase name,  NameRelationship.Direction direction, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
-       \r
+\r
        /**\r
-        * Return a List of relationships in which this name is related to another name, optionally filtered \r
+        * Return a List of relationships in which this name is related to another name, optionally filtered\r
         * by relationship type\r
-        * \r
+        *\r
         * @param name the name on the <i>"from side"</i> of the relationship\r
-        * @param type the relationship type (or null to return all relationships) \r
+        * @param type the relationship type (or null to return all relationships)\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 may be null\r
-        * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}\r
+        * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}\r
         * @return a Pager of NameRelationship instances\r
         * @deprecated use {@link #listNameRelationships(TaxonNameBase, eu.etaxonomy.cdm.model.common.RelationshipBase.Direction, NameRelationshipType, Integer, Integer, List, List)} instead\r
         */\r
        @Deprecated\r
        public List<NameRelationship> listFromNameRelationships(TaxonNameBase name,  NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
-       \r
+\r
        /**\r
-        * Return a List of relationships in which this name is related to another name, optionally filtered \r
+        * Return a List of relationships in which this name is related to another name, optionally filtered\r
         * by relationship type\r
-        * \r
+        *\r
         * @param name the name on the <i>"from side"</i> of the relationship\r
-        * @param type the relationship type (or null to return all relationships) \r
+        * @param type the relationship type (or null to return all relationships)\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 may be null\r
-        * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}\r
+        * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}\r
         * @return a Pager of NameRelationship instances\r
         * @deprecated use {@link #pageNameRelationships(TaxonNameBase, eu.etaxonomy.cdm.model.common.RelationshipBase.Direction, NameRelationshipType, Integer, Integer, List, List)} instead\r
         */\r
        @Deprecated\r
        public Pager<NameRelationship> pageFromNameRelationships(TaxonNameBase name,  NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
-       \r
+\r
        /**\r
-        * Return a List of relationships in which another name is related to this name, optionally filtered \r
+        * Return a List of relationships in which another name is related to this name, optionally filtered\r
         * by relationship type\r
-        * \r
-        * @param name the name on the <i>"to side"</i> of the relationship \r
-        * @param type the relationship type (or null to return all relationships) \r
+        *\r
+        * @param name the name on the <i>"to side"</i> of the relationship\r
+        * @param type the relationship type (or null to return all relationships)\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 may be null\r
-        * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}\r
+        * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}\r
         * @return a Pager of NameRelationship instances\r
         * @deprecated use {@link #listNameRelationships(TaxonNameBase, eu.etaxonomy.cdm.model.common.RelationshipBase.Direction, NameRelationshipType, Integer, Integer, List, List)} instead\r
         */\r
        @Deprecated\r
        public List<NameRelationship> listToNameRelationships(TaxonNameBase name,  NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
-       \r
+\r
        /**\r
-        * Return a List of relationships in which another name is related to this name, optionally filtered \r
+        * Return a List of relationships in which another name is related to this name, optionally filtered\r
         * by relationship type\r
-        * \r
-        * @param name the name on the <i>"to side"</i> of the relationship \r
-        * @param type the relationship type (or null to return all relationships) \r
+        *\r
+        * @param name the name on the <i>"to side"</i> of the relationship\r
+        * @param type the relationship type (or null to return all relationships)\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 may be null\r
-        * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}\r
+        * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}\r
         * @return a Pager of NameRelationship instances\r
         * @deprecated use {@link #pageNameRelationships(TaxonNameBase, eu.etaxonomy.cdm.model.common.RelationshipBase.Direction, NameRelationshipType, Integer, Integer, List, List)} instead\r
         */\r
        @Deprecated\r
        public Pager<NameRelationship> pageToNameRelationships(TaxonNameBase name,  NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
-       \r
-       \r
+\r
+\r
        /**\r
-        * Return a List of hybrids related to this name, optionally filtered \r
+        * Return a List of hybrids related to this name, optionally filtered\r
         * by hybrid relationship type\r
-        * \r
+        *\r
         * @param name the name\r
-        * @param type the hybrid relationship type (or null to return all hybrids) \r
+        * @param type the hybrid relationship type (or null to return all hybrids)\r
         * @param pageSize The maximum number of hybrid 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 may be null\r
-        * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}\r
+        * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}\r
         * @return a Pager of HybridRelationship instances\r
         */\r
        public Pager<HybridRelationship> getHybridNames(NonViralName name, HybridRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
-       \r
+\r
        /**\r
-        * Return a List of types related to this name, optionally filtered \r
+        * Return a List of types related to this name, optionally filtered\r
         * by type designation status\r
-        * \r
+        *\r
         * @param name the name\r
-        * @param status the type designation status (or null to return all types) \r
+        * @param status the type designation status (or null to return all types)\r
         * @param pageSize The maximum number of types returned (can be null for all types)\r
         * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
         * @return a Pager of TypeDesignationBase instances\r
         */\r
-       public Pager<TypeDesignationBase> getTypeDesignations(TaxonNameBase name, \r
+       public Pager<TypeDesignationBase> getTypeDesignations(TaxonNameBase name,\r
                        SpecimenTypeDesignationStatus status, Integer pageSize, Integer pageNumber);\r
-       \r
+\r
        public Pager<TypeDesignationBase> getTypeDesignations(TaxonNameBase name,\r
                        SpecimenTypeDesignationStatus status, Integer pageSize, Integer pageNumber, List<String> propertyPaths);\r
-       \r
-       \r
+\r
+\r
        /**\r
         * Returns a List of TaxonNameBase instances that match the properties passed\r
-        * \r
+        *\r
         * @param uninomial\r
         * @param infraGenericEpithet\r
         * @param specificEpithet\r
@@ -316,14 +454,14 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
         * @param pageSize The maximum number of names returned (can be null for all names)\r
         * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
         * @param orderHints may be null\r
-        * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}\r
+        * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}\r
         * @return a Pager of TaxonNameBase instances\r
         */\r
        public Pager<TaxonNameBase> searchNames(String uninomial, String infraGenericEpithet, String specificEpithet, String infraspecificEpithet, Rank rank, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
-       \r
+\r
        /**\r
         * Returns a Paged List of TaxonNameBase instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)\r
-        * \r
+        *\r
         * @param clazz filter the results by class (or pass null to return all TaxonNameBase instances)\r
         * @param queryString\r
         * @param pageSize The maximum number of names returned (can be null for all matching names)\r
@@ -336,26 +474,27 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
         * @return a Pager TaxonNameBase instances\r
         * @see <a href="http://lucene.apache.org/java/2_4_0/queryparsersyntax.html">Apache Lucene - Query Parser Syntax</a>\r
         */\r
-       public Pager<TaxonNameBase> search(Class<? extends TaxonNameBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
+       @Override\r
+    public Pager<TaxonNameBase> search(Class<? extends TaxonNameBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
 \r
        /**\r
         * Returns a map that holds uuid, titleCache pairs of all names in the current database\r
-        * \r
-        * @return \r
+        *\r
+        * @return\r
         *                      a <code>Map</code> containing uuid and titleCache of names\r
         */\r
        public List<UuidAndTitleCache> getUuidAndTitleCacheOfNames();\r
-       \r
+\r
        /**\r
         * Return a Pager of names matching the given query string, optionally filtered by class, optionally with a particular MatchMode\r
-        * \r
+        *\r
         * @param clazz filter by class - can be null to include all instances of type T\r
         * @param queryString the query string to filter by\r
         * @param matchmode use a particular type of matching (can be null - defaults to exact matching)\r
         * @param criteria additional criteria to filter by\r
         * @param pageSize The maximum number of objects returned (can be null for all objects)\r
         * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
-        * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}\r
+        * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}\r
         * @param orderHints\r
         *            Supports path like <code>orderHints.propertyNames</code> which\r
         *            include *-to-one properties like createdBy.username or\r
@@ -363,15 +502,15 @@ public interface INameService extends IIdentifiableEntityService<TaxonNameBase>
         * @return a paged list of instances of type T matching the queryString\r
         */\r
     public Pager<TaxonNameBase> findByName(Class<? extends TaxonNameBase> clazz, String queryString,MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
-    \r
+\r
     /**\r
      * Returns a homotypical group with the given UUID or null if not homotypical group exists with that UUID\r
-     * \r
+     *\r
      * @param uuid the uuid of the homotypical group\r
      * @return a homotypical group\r
      */\r
     public HomotypicalGroup findHomotypicalGroup(UUID uuid);\r
-    \r
+\r
     /**\r
      * @param uuid\r
      * @return\r